示例#1
0
        public async Task Controller_Should_Return_NULL_Given_a_Non_Existing_ProductId()
        {
            GetProductByIdController controller = new GetProductByIdController(this.getProductByIdService);

            var result = await controller.GetProduct(nonExistingId);

            Assert.IsNull(result.Value);
        }
示例#2
0
        public async Task Controller_Should_Return_a_Product()
        {
            GetProductByIdController controller = new GetProductByIdController(this.getProductByIdService);

            var result = await controller.GetProduct(existingId);

            Assert.IsNotNull(result.Value);

            Assert.That(result.Value, Is.InstanceOf <ProductDto>());

            Assert.AreEqual(result.Value.ProductId, existingId);
        }