public async Task TestPostProductAsync() { // Arrange var repository = RepositoryMocker.GetAdventureWorksRepository(); var controller = new ProductionController(repository, null); var request = new ProductViewModel { ProductName = String.Format("New test product {0}{1}{2}", DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond), ProductNumber = String.Format("{0}{1}{2}", DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond) }; // Act var response = await controller.PostProductAsync(request) as ObjectResult; var value = response.Value as ISingleModelResponse <ProductViewModel>; repository.Dispose(); // Assert Assert.False(value.DidError); }