91 lines
4.1 KiB
TypeScript
91 lines
4.1 KiB
TypeScript
// Camera/Tests/FT_CameraInitialization.ts
|
|
|
|
import { AC_Camera } from '#root/Camera/Components/AC_Camera.ts';
|
|
import { AC_InputDevice } from '#root/Input/Components/AC_InputDevice.ts';
|
|
import { AC_ToastSystem } from '#root/Toasts/Components/AC_ToastSystem.ts';
|
|
import { EFunctionalTestResult } from '#root/UE/EFunctionalTestResult.ts';
|
|
import { FunctionalTest } from '#root/UE/FunctionalTest.ts';
|
|
|
|
/**
|
|
* Functional Test: Camera System Initialization
|
|
* Tests basic camera initialization and device integration
|
|
* Validates initial state and component references
|
|
*/
|
|
export class FT_CameraInitialization extends FunctionalTest {
|
|
// ════════════════════════════════════════════════════════════════════════════════════════
|
|
// GRAPHS
|
|
// ════════════════════════════════════════════════════════════════════════════════════════
|
|
|
|
// ────────────────────────────────────────────────────────────────────────────────────────
|
|
// EventGraph
|
|
// ────────────────────────────────────────────────────────────────────────────────────────
|
|
|
|
/**
|
|
* Test execution - validates camera initialization
|
|
* Tests default values, device integration, and state consistency
|
|
*/
|
|
EventStartTest(): void {
|
|
// Initialize dependencies
|
|
this.ToastSystemComponent.InitializeToastSystem();
|
|
this.InputDeviceComponent.InitializeDeviceDetection(
|
|
this.ToastSystemComponent
|
|
);
|
|
|
|
// Initialize camera system
|
|
this.CameraComponent.InitializeCameraSystem(this.InputDeviceComponent);
|
|
|
|
// Validate initialization
|
|
if (
|
|
this.CameraComponent.InputDeviceComponent === this.InputDeviceComponent
|
|
) {
|
|
// Validate initial state
|
|
const { Pitch: pitch, Yaw: yaw } =
|
|
this.CameraComponent.GetCameraRotation();
|
|
|
|
if (pitch === 0.0 && yaw === 0.0) {
|
|
// Validate not rotating initially
|
|
if (!this.CameraComponent.IsCameraRotating()) {
|
|
this.FinishTest(EFunctionalTestResult.Succeeded);
|
|
} else {
|
|
this.FinishTest(
|
|
EFunctionalTestResult.Failed,
|
|
'Camera should not be rotating initially'
|
|
);
|
|
}
|
|
} else {
|
|
this.FinishTest(
|
|
EFunctionalTestResult.Failed,
|
|
`Initial rotation should be 0,0 but got Pitch=${pitch}, Yaw=${yaw}`
|
|
);
|
|
}
|
|
} else {
|
|
this.FinishTest(
|
|
EFunctionalTestResult.Failed,
|
|
'Input device component reference not set correctly'
|
|
);
|
|
}
|
|
}
|
|
|
|
// ════════════════════════════════════════════════════════════════════════════════════════
|
|
// VARIABLES
|
|
// ════════════════════════════════════════════════════════════════════════════════════════
|
|
|
|
/**
|
|
* Camera system component - component under test
|
|
* @category Components
|
|
*/
|
|
private CameraComponent = new AC_Camera();
|
|
|
|
/**
|
|
* Input device detection system - required for camera initialization
|
|
* @category Components
|
|
*/
|
|
private InputDeviceComponent = new AC_InputDevice();
|
|
|
|
/**
|
|
* Toast notification system - required for input device initialization
|
|
* @category Components
|
|
*/
|
|
private ToastSystemComponent = new AC_ToastSystem();
|
|
}
|