public void CreateTest() { // Arrange var category = new CategoryHeaderModel(); category.Name = "TestKort"; category.CategoryHeaderModelId = -1; // Act _service.Create(category); // Assert _ICategoryHeaderRepo.Verify(r => r.InsertOrUpdate(category)); }
public void Create() { // Arrange CategoryHeaderModel category = new CategoryHeaderModel() { CategoryHeaderModelId = -1, Name = "TestKort" }; // Act var result = _service.Create(category); // Assert try { _mockRepository.Verify(c => c.InsertOrUpdate(category)); } catch (Moq.MockException eM) { eM.GetBaseException(); } Assert.IsNotNull(result); }