public static void ClassInitialize(TestContext context) { //INITIALIZED ALL THE MOCK OBJECTS NEEDED FOR TESTING MockFactory mockFactory = new MockFactory(); _libraryConfigurationMocked = mockFactory.CreateMock <IXXXLibraryConfiguration>(); _IAircraftRecoverAndPersistMocked = mockFactory.CreateMock <IAircraftRecoverAndPersist>(); //INITIALIZED SERVICE TO BE TESTED Sut = new SeatAssignment(_IAircraftRecoverAndPersistMocked.MockObject, _libraryConfigurationMocked.MockObject); //COMPLETE SCENARIO _IAircraftRecoverAndPersistMocked.Expects.One.Method(x => x.UpdateAircraft(default(Aircraft))).WithAnyArguments().WillReturn(false); }
public static void ClassInitialize(TestContext context) { //INITIALIZED ALL THE MOCK OBJECTS NEEDED FOR TESTING MockFactory mockFactory = new MockFactory(); _libraryConfigurationMocked = mockFactory.CreateMock <IXXXLibraryConfiguration>(); _IAircraftRecoverAndPersistMocked = mockFactory.CreateMock <IAircraftRecoverAndPersist>(); //INITIALIZED OBJECT CONTROLLER FOR UNIT TESTING Sut = new SeatAssignment(_IAircraftRecoverAndPersistMocked.MockObject, _libraryConfigurationMocked.MockObject); //COMPLETE SCENARIO _libraryConfigurationMocked.Expects.One.GetProperty(v => v.TimeSalesCloseBeforeFlight).WillReturn(2); _IAircraftRecoverAndPersistMocked.Expects.One.Method(x => x.UpdateAircraft(default(Aircraft))).WithAnyArguments().WillReturn(true); }