Exemplo n.º 1
0
        public MockProductRepository ExistProductAsync()
        {
            Setup(x => x.ExistsAsync(It.Is <Guid>(e => e.Equals(Guid.Parse("4d8830e2-465c-4a54-ad02-f875073c85dc")) || e.Equals(Guid.Parse("7a56023f-4811-4a75-9768-6aaf7985bb1a")) || e.Equals(Guid.Parse("B99BC862-C515-4D61-97D8-4D2B188A19F3")))))
            .Returns((Guid id) => Task.FromResult(ProductStub.ExistProduct()));

            Setup(x => x.ExistsAsync(It.Is <Guid>(e => !e.Equals(Guid.Parse("4d8830e2-465c-4a54-ad02-f875073c85dc")) && !e.Equals(Guid.Parse("7a56023f-4811-4a75-9768-6aaf7985bb1a")))))
            .Returns(() => Task.FromResult(ProductStub.NotExistProduct()));
            return(this);
        }
Exemplo n.º 2
0
        public MockProductService ExistProductAsync()
        {
            Setup(x => x.ExistProductAsync(It.Is <Guid>(e => e.Equals(Guid.Parse("B99BC862-C515-4D61-97D8-4D2B188A19F3")) || e.Equals(Guid.Parse("A16C605C-0A1A-4E63-857F-68019CE2575C")))))
            .Returns((Guid id) => Task.FromResult(ProductStub.ExistProduct()));

            Setup(x => x.ExistProductAsync(It.Is <Guid>(e => !e.Equals(Guid.Parse("B99BC862-C515-4D61-97D8-4D2B188A19F3")) && !e.Equals(Guid.Parse("A16C605C-0A1A-4E63-857F-68019CE2575C")))))
            .Returns(() => throw new BusinessException("Product doesn't exist"));
            return(this);
        }
Exemplo n.º 3
0
        public MockProductService ExistProductAsync()
        {
            Setup(x => x.ExistProductAsync(It.Is <Guid>(e => e.Equals(Guid.Parse("4d8830e2-465c-4a54-ad02-f875073c85dc")) || e.Equals(Guid.Parse("7a56023f-4811-4a75-9768-6aaf7985bb1a")) || e.Equals(Guid.Parse("B99BC862-C515-4D61-97D8-4D2B188A19F3")))))
            .Returns((Guid id) => Task.FromResult(ProductStub.ExistProduct()));

            Setup(x => x.ExistProductAsync(It.Is <Guid>(e => !e.Equals(Guid.Parse("4d8830e2-465c-4a54-ad02-f875073c85dc")) && !e.Equals(Guid.Parse("7a56023f-4811-4a75-9768-6aaf7985bb1a")))))
            .Returns(() => throw new BusinessException("Product doesn't exist"));
            return(this);
        }