public void DeleteRow() { var objT = new IQueryableType { Id = 15 }; var resource = new Mock <IOperationResource>(); resource.Setup(c => c.DeleteResourceRecordById(new object[] { "15" })) .Returns(objT); resourceFactoryMock.Setup(c => c.GetResource("conn1", OperationType.delete, "table1")) .Returns(resource.Object); var result = tableOperations.DeleteRow("conn1", "table1", "15"); Assert.AreEqual(0, loggingService.LogCount); Assert.AreEqual(15, ((IQueryableType)result).Id); }