Exemplo n.º 1
0
        public async Task Get_Component_Inexistent_ShouldReturn_RestException()
        {
            var mockedContext = new EletronicPartsCatalogContextMock().GetMockedContextWithData();
            var sut           = new Details.QueryHandler(mockedContext);
            var message       = new Details.Query("slug");

            await Assert.ThrowsAsync <RestException>(() => sut.Handle(message, CancellationToken.None));
        }
Exemplo n.º 2
0
 public async Task Get_User_Inexistent_ShouldReturn_RestException()
 {
     var mockedContext = new EletronicPartsCatalogContextMock().GetMockedContextWithData();
     var mockedMapper  = new Mock <IMapper>();
     var sut           = new Details.QueryHandler(mockedContext, mockedMapper.Object);
     var message       = new Details.Query
     {
         Username = "******"
     };
     await Assert.ThrowsAsync <RestException>(() => sut.Handle(message, CancellationToken.None));
 }
Exemplo n.º 3
0
        public async Task Get_Profile_Inexistent_ShouldReturn_NoResult()
        {
            var mockedProfileReader = new Mock <IProfileReader>();
            var sut     = new Details.QueryHandler(mockedProfileReader.Object);
            var message = new Details.Query
            {
                Username = "******"
            };
            var result = await sut.Handle(message, CancellationToken.None);

            Assert.Null(result);
        }