public static SlotCabinetRegistration BuildFor(SlotCabinet slotCabinet, bool addRegisterEvent = true, Action <SlotCabinetRegistration> customize = null) { var slotCabinetRegistration = new SlotCabinetRegistration { MacAddress = Utils.SampleMacAddress(), SasVersion = "SasVersion", SlotCabinetId = slotCabinet.SlotCabinetId, RegistrationDateTime = SliceFixture.GetSystemDateTime(), }; customize?.Invoke(slotCabinetRegistration); slotCabinet.SlotCabinetRegistrations.Add(slotCabinetRegistration); if (addRegisterEvent) { //auto add a register cabinet event on new cabinet registration addition var slotCabinetEvent = SlotCabinetEventBuilderNew.BuildFor(slotCabinetRegistration, sce => { sce.EventTypeId = (int)SlotEventType.RegisterCabinet; }); slotCabinetRegistration.SlotCabinetEvents.Add(slotCabinetEvent); } return(slotCabinetRegistration); }
public static SlotCabinetPeriodicHealth BuildFor(SlotCabinetRegistration registration, Action <SlotCabinetPeriodicHealth> customize = null) { var periodicHealth = new SlotCabinetPeriodicHealth { SlotCabinetRegistrationId = registration.SlotCabinetRegistrationId, RecordDateTime = SliceFixture.GetSystemDateTime(), }; customize?.Invoke(periodicHealth); return(periodicHealth); }
public static SlotCabinetEvent BuildFor(SlotCabinetRegistration registration, Action <SlotCabinetEvent> customize = null) { var eventSequenceId = Guid.NewGuid(); var slotCabinetEvent = new SlotCabinetEvent { EventSequenceId = eventSequenceId, SlotCabinetRegistrationId = registration.SlotCabinetRegistrationId, ProcessSequenceId = Guid.NewGuid(), EventDateTime = SliceFixture.GetSystemDateTime(), EventTypeId = (int)SlotEventType.Unknown }; customize?.Invoke(slotCabinetEvent); registration.SlotCabinetEvents.Add(slotCabinetEvent); return(slotCabinetEvent); }