public void ManagePurchaseType_CarObj_IsNull() { //Arrange var sut = new PurchaseTypeRepository(_mockContext.Object); //Act var returnedValue = sut.ManagePurchaseType(null); //Assert Assert.Equal(0, returnedValue); }
public void ManagePurchaseType_CarObj_IsNotNull_Edit_ShouldCallCorrectMethods() { //Arrange var sut = new PurchaseTypeRepository(_mockContext.Object); //Act _ = sut.ManagePurchaseType(new PurchaseType() { PurchaseTypeName = "d1" }); //Assert _mockContext.Verify(x => x.PurchaseTypes.Add(It.IsAny <PurchaseType>()), Times.Never); _mockContext.Verify(x => x.SaveChanges(), Times.Once); }