public void Create_Test() { //Arrange var orderRepository = new OrderRepository(_contextMock.Object); //Act var order = new Order(); orderRepository.Create(order); //Assert _mockSet.Verify(m => m.Add(It.IsAny <Order>()), Times.Once()); }
public void Can_Create() { var city = new City(); _sutRepo.Create(city); _mockCitiesDbSet.Verify(x => x.Add(city), Times.Exactly(1)); }
public void DeleteCallsRemoveOnDbSet() { SetUpDbSet(new List <Instrument>()); var response = Browser.Delete("/exchanges/1", BrowserCtx); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); DbSetMock.Verify(x => x.Remove(It.Is <Exchange>(e => e.ID == 1))); }