public void GetParameterDefinition() { var obj = new StoredProcedureParameterDefinition { Name = "param1" }; Ops.Setup(c => c.Definition("conn", "proc", "param1", LoggingService)) .Returns(obj); var controller = new StoredProcedureDefinitionController(Ops.Object, LoggingService); var results = controller.Get("conn", "proc", "param1"); Assert.AreEqual("param1", obj.Name); }
public void ProcParamDefinition() { var definition = new StoredProcedureParameterDefinition { Name = "returned" }; var resource = new Mock <IOperationResource>(); resource.Setup(c => c.GetStoredProcedureDefinition("name")) .Returns(definition); resourceFactoryMock.Setup(c => c.GetResource("conn1", OperationType.Any, "proc1")) .Returns(resource.Object); var result = storedProcedureOperations.Definition("conn1", "proc1", "name"); Assert.AreEqual(0, loggingService.LogCount); Assert.AreEqual(definition, result); }