コード例 #1
0
        public void Initialize()
        {
            flighServiceMock   = new Mock <IFlightService>();
            bookingServiceMock = new Mock <IBookingService>();
            objController      = new PassengersController(flighServiceMock.Object, bookingServiceMock.Object);
            CultureInfo cultureInfo = new CultureInfo("nl-NL");

            listPassengers = new List <Person>()
            {
                new Person
                {
                    Id        = 77,
                    Address   = "P.O. Box 795, 1956 Odio. Rd.",
                    DateBirth = DateTime.Parse("01/01/1940", cultureInfo),
                    Email     = "*****@*****.**",
                    Gender    = GenderType.Male,
                    Name      = "Branden Johnston"
                },
                new Person
                {
                    Id        = 96,
                    Address   = "P.O. Box 660, 6702 Nunc St.",
                    DateBirth = DateTime.Parse("17/03/1981", cultureInfo),
                    Email     = "*****@*****.**",
                    Gender    = GenderType.Male,
                    Name      = "Germaine Fowler"
                },
            };
        }
コード例 #2
0
        public void Setup()
        {
            _personRepository = new PersonAsyncRepository();
            var loggerMock       = new Mock <ILogger <PassengerDTO> >();
            var passengerService = new PassengerService(_personRepository);

            _controller = new PassengersController(loggerMock.Object, passengerService);
        }
コード例 #3
0
            public void SetUp()
            {
                transportSystem             = Substitute.For <ITransportSystem>();
                neighborsManager            = Substitute.For <INeighborsManager>();
                transportSystemSatisfaction = Substitute.For <ITransportSystemSatisfaction>();
                passengersFactory           = Substitute.For <IPassengersFactory>();
                passengersFactory.CreatePassengers(Arg.Any <int>(), Arg.Any <int>())
                .Returns(new PassengerDto[0]);

                controller = new PassengersController(transportSystem, passengersFactory, neighborsManager,
                                                      transportSystemSatisfaction);
            }
コード例 #4
0
 public void SetUp()
 {
     _mockService = new Mock <PassengerService>();
     subject      = new PassengersController(_mockService.Object);
 }
コード例 #5
0
 public PassengerUnitTest()
 {
     _passengerController = new PassengersController(mockDtaRepository.Object);
 }