public void VerifyPaging_DefaultValues() { // Arrange var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo); smartObject.MethodToExecute = smartObject.Methods[0].Name; DataTable dataTable1 = DataTableFactory.GetDataTableWithOneColumnAndOneRow(); SmartObjectClientServer server = null; MockWrapperFactory.Instance.SmartObjectClientServer .Setup(x => x.ExecuteListDataTable( It.IsAny <SmartObject>(), It.IsAny <ExecuteListOptions>())) .Returns(dataTable1); MockWrapperFactory.Instance.SmartObjectClientServer .Setup(x => x.ExecuteListReader( It.IsAny <SmartObject>(), It.IsAny <ExecuteListReaderOptions>())) .Returns(default(SmartObjectReader)); // Action SmartObjectHelper.VerifyPaging(server, smartObject, 0); }
public void VerifyAllReturnPropertiesHasValues_WithMethod_NoReturn() { // Arrange var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo); // Action SmartObjectHelper.VerifyAllReturnPropertiesHasValues(smartObject.Methods[0]); }
public void VerifyAllReturnPropertiesHasValues_WithNull() { // Arrange SmartMethodBase method = null; // Action SmartObjectHelper.VerifyAllReturnPropertiesHasValues(method); }
public void CompareDataTables() { // Arrange DataTable dataTable1 = DataTableFactory.GetDataTableWithOneColumnAndOneRow(); // Action SmartObjectHelper.CompareDataTables(dataTable1, dataTable1.DefaultView.ToTable()); }
public void GetServiceInstance_IsNull() { // Action var serviceConfig = SmartObjectHelper.GetServiceInstance(Guid.NewGuid()); // Assert Assert.IsNull(serviceConfig); }
public void ExecuteSQLQueryDataTable_DefaultValues() { // Arrange SmartObjectClientServer server = null; // Action SmartObjectHelper.ExecuteSQLQueryDataTable(server, "SELECT * FROM REGION"); }
public void ExecuteBulkScalar_DefaultValues() { // Arrange SmartObjectClientServer server = null; var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo); // Action SmartObjectHelper.ExecuteBulkScalar(server, smartObject, new DataTable()); }
public void ExecuteListReader_DefaultValues() { // Arrange SmartObjectClientServer server = null; var smartObject = SmartObjectFactory.GetSmartObject(SmartObjectOption.ProcessInfo); // Action SmartObjectHelper.ExecuteListReader(server, smartObject); }
internal DataTable DeserializeTypedArray(string serviceObjectName, ServiceInstanceSettings serviceInstanceSettings, string value) { var smartObject = SmartObjectHelper.GetSmartObject(this, serviceObjectName, serviceInstanceSettings); smartObject.MethodToExecute = "DeserializeTypedArray"; smartObject.SetInputPropertyValue("Serialized_Array", value); var dataTable = SmartObjectHelper.ExecuteListDataTable(this, smartObject); return(dataTable); }
internal SmartObject Deserialize(string serviceObjectName, ServiceInstanceSettings serviceInstanceSettings, string value) { var smartObject = SmartObjectHelper.GetSmartObject(this, serviceObjectName, serviceInstanceSettings); smartObject.MethodToExecute = "Deserialize"; smartObject.SetInputPropertyValue("Serialized_Item__String_", value); SmartObjectHelper.ExecuteScalar(this, smartObject); return(smartObject); }
public void GetSmartObject_DefaultValues() { // Arrange SmartObjectClientServer server = null; MockWrapperFactory.Instance.WithProcessInstanceSmartObject(out SmartObject expected, out ServiceInstanceSettings settings); // Action var actual = SmartObjectHelper.GetSmartObject(server, Guid.NewGuid().ToString(), Mock.Of <ServiceInstanceSettings>()); // Assert Assert.AreEqual(expected, actual); }
public void GetSmartObjectDefinition_DefaultValues() { // Arrange MockWrapperFactory.Instance.SmartObjectManagementServer .Setup(i => i.GetSmartObjectDefinition( It.IsAny <string>())) .Returns(Resources.SmartObjectDefinition_ProcessInfo); // Action var actual = SmartObjectHelper.GetSmartObjectDefinition(Guid.NewGuid().ToString()); // Assert Assert.IsNotNull(actual); }
public void GetServiceInstance_WithGuid() { // Arrange MockWrapperFactory.Instance.ServiceManagementServer .Setup(i => i.GetServiceInstanceCompact( It.IsAny <Guid>())) .Returns(Resources.ServiceInstance_URMService); // Action var serviceConfig = SmartObjectHelper.GetServiceInstance(Guid.NewGuid()); // Assert Assert.IsNotNull(serviceConfig); }
public void GetServiceType_Null() { // Action MockWrapperFactory.Instance.ServiceManagementServer .Setup(i => i.GetServiceType( It.IsAny <Guid>())) .Returns(string.Empty); // Action var serviceType = SmartObjectHelper.GetServiceType(Guid.NewGuid()); // Assert Assert.IsNull(serviceType); }
public void GetServiceTypeInfo_DefaultValues() { // Action MockWrapperFactory.Instance.ServiceManagementServer .Setup(i => i.GetServiceType( It.IsAny <Guid>())) .Returns(Resources.ServiceType_ADService); // Action var serviceType = SmartObjectHelper.GetServiceTypeInfo(Guid.NewGuid()); // Assert Assert.IsNotNull(serviceType); }
public void GetServiceInstance_WithServiceInstanceSettings() { // Arrange MockWrapperFactory.Instance.SmartObjectManagementServer .Setup(i => i.GetServiceInstance( It.IsAny <Guid>(), It.IsAny <ServiceExplorerLevel>())) .Returns(Resources.ServiceInstance_URMService); // Action var serviceConfig = SmartObjectHelper.GetServiceInstance(Mock.Of <ServiceInstanceSettings>()); // Assert Assert.IsNotNull(serviceConfig); }
public void GetServiceObject_DefaultValues() { // Arrange MockWrapperFactory.Instance.SmartObjectManagementServer .Setup(i => i.GetServiceInstanceServiceObject( It.IsAny <Guid>(), It.IsAny <string>())) .Returns(Resources.ServiceObject_ProcessOverview); // Action var serviceObject = SmartObjectHelper.GetServiceObject(Mock.Of <ServiceInstanceSettings>(), Guid.NewGuid().ToString()); // Assert Assert.IsNotNull(serviceObject); }
internal string SerializeItemToArray(string serviceObjectName, ServiceInstanceSettings serviceInstanceSettings, params Action <SmartObject>[] actions) { actions.ThrowIfNull("actions"); var smartObject = SmartObjectHelper.GetSmartObject(this, serviceObjectName, serviceInstanceSettings); smartObject.MethodToExecute = "SerializeItemToArray"; foreach (var action in actions) { action(smartObject); } SmartObjectHelper.ExecuteScalar(this, smartObject); return(smartObject.Properties["Serialized_Array"].Value); }
internal string Serialize(string serviceObjectName, ServiceInstanceSettings serviceInstanceSettings, params Action <SmartObject>[] actions) { actions.ThrowIfNull("actions"); var smartObject = SmartObjectHelper.GetSmartObject(this, serviceObjectName, serviceInstanceSettings); smartObject.MethodToExecute = "Serialize"; foreach (var action in actions) { action(smartObject); } var serialized = SmartObjectHelper.ExecuteScalar(this, smartObject); return(serialized.GetReturnPropertyValue("Serialized_Item__String_")); }
public void DeleteSmartObject_SmartObjectNotExists() { // Arrange var smartObjectInfo = SmartObjectInfo.Create(Resources.SmartObjectDefinition_ProcessInfo); SmartObjectManagementServer smartObjectManagementServer = null; var mockSmartObjectExplorer = Mock.Of <SmartObjectExplorer>(); mockSmartObjectExplorer.SmartObjects.Add(smartObjectInfo); MockWrapperFactory.Instance.SmartObjectManagementServer .Setup(i => i.GetSmartObjects( It.IsAny <string>())) .Returns(mockSmartObjectExplorer); // Action SmartObjectHelper.DeleteSmartObject(smartObjectManagementServer, Guid.NewGuid().ToString()); }
public void PublishSmartObjectsFromResources_DefaultValues() { // Arrange var smartObjectInfo = SmartObjectInfo.Create(Resources.SmartObjectDefinition_ProcessInfo); var mockSmartObjectExplorer = Mock.Of <SmartObjectExplorer>(); mockSmartObjectExplorer.SmartObjects.Add(smartObjectInfo); MockWrapperFactory.Instance.SmartObjectManagementServer .Setup(i => i.GetSmartObjects( It.IsAny <string>())) .Returns(mockSmartObjectExplorer); var smartObjectDefinitionsPublish = new SmartObjectDefinitionsPublish(); smartObjectDefinitionsPublish.SmartObjects.Add(new SmartObjectDefinition()); // Action SmartObjectHelper.PublishSmartObjectsFromResources(this.GetType().Assembly, null); }
public void GetSmartObjects_DefaultValues() { // Arrange var expected = SmartObjectInfo.Create(Resources.SmartObjectDefinition_ProcessInfo); var mockSmartObjectExplorer = Mock.Of <SmartObjectExplorer>(); mockSmartObjectExplorer.SmartObjects.Add(expected); MockWrapperFactory.Instance.SmartObjectManagementServer .Setup(i => i.GetSmartObjects( It.IsAny <Guid[]>())) .Returns(mockSmartObjectExplorer); // Action var actual = SmartObjectHelper.GetSmartObjects(new Guid[] { }); // Assert Assert.AreEqual(expected, actual.FirstOrDefault()); }
public void ContainsSmartObject() { // Arrange var smartObjectInfo = SmartObjectInfo.Create(Resources.SmartObjectDefinition_ProcessInfo); SmartObjectManagementServer smartObjectManagementServer = null; var mockSmartObjectExplorer = Mock.Of <SmartObjectExplorer>(); mockSmartObjectExplorer.SmartObjects.Add(smartObjectInfo); MockWrapperFactory.Instance.SmartObjectManagementServer .Setup(i => i.GetSmartObjects( It.IsAny <string>())) .Returns(mockSmartObjectExplorer); // Action var actual = SmartObjectHelper.ContainsSmartObject(smartObjectManagementServer, smartObjectInfo.Name); // Assert Assert.IsTrue(actual); }