public void Init() { _apiSettingsData = new Mock <IApiSettingsData>(); _chaosConfigurationSettings = new Mock <IApiChaosConfigurationSettingsData>(); _cacheInvalidator = new Mock <ICacheInvalidator>(); _hostsController = new HostsController(_apiSettingsData.Object, _chaosConfigurationSettings.Object, _cacheInvalidator.Object); }
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)); }
public void Index() { // Arrange HostsController controller = new HostsController(); // Act ViewResult result = controller.Index(null) as ViewResult; // Assert Assert.IsNotNull(result); }
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); }
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); }