Пример #1
0
        public void Setup()
        {
            AlwaysValidValidator = A.Fake <IValidator <TicketDTO> >();
            var validValidationResult = new ValidationResult();

            A.CallTo(() => AlwaysValidValidator.Validate(A <TicketDTO> ._)).Returns(validValidationResult);

            AlwaysInValidValidator = A.Fake <IValidator <TicketDTO> >();
            var validationFailure       = new ValidationFailure("Property", "Is Invalid");
            var invalidValidationResult = new ValidationResult(new[] { validationFailure });

            A.CallTo(() => AlwaysInValidValidator.Validate(A <TicketDTO> ._)).Returns(invalidValidationResult);
        }
Пример #2
0
        public void Setup()
        {
            AlwaysValidValidator = A.Fake <IValidator <AirhostessDTO> >();
            var validValidationResult = new ValidationResult();

            A.CallTo(() => AlwaysValidValidator.Validate(A <AirhostessDTO> ._)).Returns(validValidationResult);

            AirportDbContext   = ServicesTestsSetup.GetAirportDbContext();
            AirportInitializer = ServicesTestsSetup.GetAirportInitializer(ServicesTestsSetup.GetAirportDbContext());
            UnitOfWork         = ServicesTestsSetup.GetUnitOfWork(AirportDbContext);

            AirportInitializer.Seed().Wait();
        }