Esempio n. 1
0
        public async Task DeleteVendor_ReturnsTrue()
        {
            // arrange
            var vendor = new Vendor {
                id = 123
            };

            _vendorsQueryMock.Setup(x => x.Delete(vendor.id.Value))
            .Returns(Task.Factory.StartNew(() => true));

            // act
            var task = await _sut.Delete(vendor.id.Value);

            // assert
            Assert.IsType <OkObjectResult>(task);

            var result      = task as OkObjectResult;
            var usersResult = result.Value as bool?;

            Assert.True(usersResult.Value);
        }