public ContractHierarchy RenameContract(ContractHierarchy node) { if (node != null) { return(_contractLogic.RenameContract(node.NodeId, node.NodeText, node.UserName)); } return(null); }
public void RenameContractUnitTest() { ContractHierarchy objContractHierarchy = new ContractHierarchy { NodeId = 1, NodeText = "TestFileName", UserName = "******" }; var mockContractrepository = new Mock <IContractRepository>(); var mockContractServiceTypeLogic = new Mock <IContractServiceTypeLogic>(); var mockPaymentResultLogic = new Mock <IPaymentResultLogic>(); mockContractrepository.Setup(f => f.RenameContract(It.IsAny <long>(), It.IsAny <string>(), It.IsAny <string>())).Returns(objContractHierarchy); ContractLogic target = new ContractLogic(mockContractrepository.Object, mockContractServiceTypeLogic.Object, mockPaymentResultLogic.Object); ContractHierarchy actual = target.RenameContract(1, "TestFileName", "Ragini"); //Assert.AreNotSame(actual, objContractHierarchy); Assert.AreSame(actual, objContractHierarchy); }