public void WithControllerChild_ShouldReturnDtoChild() { IController controller = ChildController( activeAlarm: Alarm("Special Child Alarm", AlarmType.Warning)).Object; PlcInformationDtoAssembler assembler = CreateAssembler(); ControllerDTO dto = assembler.AssembleControllerDto(controller); dto.ShouldHaveValues( activeAlarm: "Special Child Alarm", alarmType: PlcEssentials.PlcInformation.DTOs.AlarmType.Warning, currentState: "Ready", currentSubState: "Sub-Ready", enableForcing: false, id: 2, isEnabled: false, isSimulated: false, mode: PlcEssentials.PlcInformation.DTOs.ControllerMode.Manual, name: "Child", fullname: "Child", type: "ChildType"); }
public void WithControllerRoot_ShouldReturnDtoRoot() { IController controller = Controller( activeAlarm: Alarm("Root Alarm", AlarmType.Info), actualValues: new Tag[0], children: new IController[0], commands: new ICommand[0], configurations: new Tag[0], controllerMode: ControllerMode.Auto, currentState: "Running", currentSubState: "Sub-Running", enableForcing: true, id: 1, isEnabled: true, isSimulation: true, name: "Root", fullname: "Root", parameters: new Tag[0], type: "RootController").Object; PlcInformationDtoAssembler assembler = CreateAssembler(); ControllerDTO dto = assembler.AssembleControllerDto(controller); dto.ShouldHaveValues( activeAlarm: "Root Alarm", alarmType: PlcEssentials.PlcInformation.DTOs.AlarmType.Normal, currentState: "Running", currentSubState: "Sub-Running", enableForcing: true, id: 1, isEnabled: true, isSimulated: true, mode: PlcEssentials.PlcInformation.DTOs.ControllerMode.Auto, name: "Root", fullname: "Root", type: "RootController"); }