コード例 #1
0
        public void Init()
        {
            _apiSettingsData            = new Mock <IApiSettingsData>();
            _chaosConfigurationSettings = new Mock <IApiChaosConfigurationSettingsData>();
            _cacheInvalidator           = new Mock <ICacheInvalidator>();

            _hostsController = new HostsController(_apiSettingsData.Object, _chaosConfigurationSettings.Object, _cacheInvalidator.Object);
        }
コード例 #2
0
        public void MockInitialize()
        {
            _repo = new MockHostsRepo();
            Profiles            profile       = new Profiles();
            MapperConfiguration configuration = new MapperConfiguration(cfg => cfg.AddProfile(profile));

            _controller = new HostsController(_repo, new Mapper(configuration));
        }
コード例 #3
0
        public void Index()
        {
            // Arrange
            HostsController controller = new HostsController();

            // Act
            ViewResult result = controller.Index(null) as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
コード例 #4
0
        public void MockInitialize()
        {
            _reservationsRepo = new MockReservationsRepo();
            _hostsRepo        = new MockHostsRepo();
            _guestsRepo       = new MockGuestsRepo();
            Profiles            profile       = new Profiles();
            MapperConfiguration configuration = new MapperConfiguration(cfg => cfg.AddProfile(profile));
            IMapper             mapper        = new Mapper(configuration);

            _guestsController       = new GuestsController(_guestsRepo);
            _hostsController        = new HostsController(_hostsRepo, mapper);
            _reservationsController = new ReservationsController(_reservationsRepo, _guestsRepo, _hostsRepo, mapper);
        }
コード例 #5
0
        public void SetUp()
        {
            ServiceLocatorInitializer.Init();

            hostManagementService =
                MockRepository.GenerateMock <IHostManagementService>();

            hostSearchManagementService =
                MockRepository.GenerateMock <IHostSearchManagementService>();
            _personManagementService = MockRepository.GenerateMock <IPersonManagementService>();
            _authenticationProvider  = MockRepository.GenerateMock <IAuthenticationProvider>();
            hostsController          =
                new HostsController(hostManagementService, hostSearchManagementService, _personManagementService,
                                    _authenticationProvider);
        }