public FilmeControllerTests(ApiFixture apiFixture)
        {
            apiFixture.Initialize().GetAwaiter().GetResult();

            _apiFixture     = apiFixture;
            _httpClient     = _apiFixture.GetAuthHttpClient();
            _endpoint       = ConfigManagerIntegration.ConfigRunTests.EndpointFilme;
            _systemSettings = ConfigManager.SystemSettings;

            _wireMockServer = WireMockServer.Start(ConfigManagerIntegration.ConfigRunTests.ServerPort);
            _request        = Request
                              .Create()
                              .WithPath(new WildcardMatcher(ConfigManager.ApiFilmesSettings.EndpointFilmes))
                              .UsingGet();

            IEnumerable <FilmeModel> cache;

            A.CallTo(() => _apiFixture.MemoryCacheWrapperFake
                     .TryGetValue(_systemSettings.FilmesCacheKey, out cache))
            .Returns(false);

            A.CallTo(() => _apiFixture.MemoryCacheWrapperFake
                     .GetOrCreateAsync(_systemSettings.FilmesCacheKey, A <Func <ICacheEntry, Task <IEnumerable <FilmeModel> > > > .Ignored))
            .CallsBaseMethod();
        }
        public UsuarioControllerTests(ApiFixture apiFixture)
        {
            apiFixture.Initialize().GetAwaiter().GetResult();

            _apiFixture = apiFixture;
            _httpClient = _apiFixture.GetHttpClient();
        }
        public LoginControllerTests(ApiFixture apiFixture)
        {
            apiFixture.Initialize().GetAwaiter().GetResult();

            _apiFixture = apiFixture;
            _httpClient = _apiFixture.GetHttpClient();
            _endpoint   = ConfigManagerIntegration.ConfigRunTests.EndpointLogin;
        }
예제 #4
0
        public CampeonatoControllerTests(ApiFixture apiFixture)
        {
            apiFixture.Initialize().GetAwaiter().GetResult();

            _endpoint       = ConfigManagerIntegration.ConfigRunTests.EndpointCampeonato;
            _systemSettings = ConfigManager.SystemSettings;
            _httpClient     = apiFixture.GetAuthHttpClient();

            _wireMockServer = WireMockServer.Start(ConfigManagerIntegration.ConfigRunTests.ServerPort);
        }