Esempio n. 1
0
        public async Task New_Busca_Heroi_FailAsync()
        {
            var mockMarvelClient       = Mock_IMarvelApiClient_Teste().Object;
            var mockIMd5Encode         = Mock_IMd5Encode_Teste().Object;
            var mockMarvelConfiguratio = new MarvelApiAdapterConfiguration()
            {
                AppKey           = publicKey,
                PrivateKey       = privateKey,
                TimeStampDefault = timestamp,
                UrlBase          = ""
            };

            var mockLog = new Mock <ILogger <MarvelApiHeroAdapter> >().Object;

            var marvelApiAdapter = new MarvelApiHeroAdapter(mockMarvelClient, mockMarvelConfiguratio, mockIMd5Encode, mockLog);

            var result = await marvelApiAdapter.BuscarHeroiAsync(nomeHeroi_zuado);

            Assert.Equal(0, result.Count);
        }
Esempio n. 2
0
        public async Task New_Busca_Heroi_SucessAsync()
        {
            var mockMarvelClient       = Mock_IMarvelApiClient_Teste().Object;
            var mockIMd5Encode         = Mock_IMd5Encode_Teste().Object;
            var mockMarvelConfiguratio = new MarvelApiAdapterConfiguration()
            {
                AppKey           = publicKey,
                PrivateKey       = privateKey,
                TimeStampDefault = timestamp,
                UrlBase          = ""
            };

            var mockLog = new Mock <ILogger <MarvelApiHeroAdapter> >().Object;

            var marvelApiAdapter = new MarvelApiHeroAdapter(mockMarvelClient, mockMarvelConfiguratio, mockIMd5Encode, mockLog);

            var result = await marvelApiAdapter.BuscarHeroiAsync(nomeHeroi);

            Assert.Equal(nomeHeroi, result.First().Nome);
            Assert.Single(result.First().Historias.Items);
        }