public void BuildProperties_GivenActionSourceTypeRegionRegionNullValues_ExpectNoError_DefinedValues() { //------------Setup for test-------------------------- var act = new ViewPropertyBuilder() { }; var serviceModel = new Mock <IDbServiceModel>(); var dsfSqlServerDatabaseActivity = new DsfSqlServerDatabaseActivity() { ProcedureName = "proc a" }; IDbActionToolRegion <IDbAction> actionRegion = new DbActionRegion(serviceModel.Object, ModelItemUtils.CreateModelItem(dsfSqlServerDatabaseActivity), new DatabaseSourceRegion(), new SynchronousAsyncWorker()); var sourceRegion = new Mock <ISourceToolRegion <IDbSource> >(); sourceRegion.Setup(region => region.SelectedSource).Returns(new DbSourceDefinition() { Name = "Sourcename" }); //------------Execute Test--------------------------- Assert.IsNotNull(act); var keyValuePairs = act.BuildProperties(actionRegion, sourceRegion.Object, "DsfSqlServerDatabaseActivity"); //------------Assert Results------------------------- Assert.AreEqual(3, keyValuePairs.Count); var keySource = keyValuePairs.Single(pair => pair.Key == "Source :").Value; var keyType = keyValuePairs.Single(pair => pair.Key == "Type :").Value; var keyProcedure = keyValuePairs.Single(pair => pair.Key == "Procedure :").Value; Assert.AreEqual("Sourcename", keySource); Assert.AreEqual("DsfSqlServerDatabaseActivity", keyType); Assert.AreEqual("proc a", keyProcedure); }
public void ViewPropertyBuilder_Constructor() { var act = new ViewPropertyBuilder() { }; Assert.IsNotNull(act); }
public AdvancedRecordsetDesignerViewModel(ModelItem modelItem, ISqliteServiceModel model) : base(modelItem) { _modelItem = modelItem; _propertyBuilder = new ViewPropertyBuilder(); Model = model; SetupCommonProperties(); SetupDeclareVariables(modelItem); HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_AdvancedRecordset; }
public void BuildProperties_GivenNullValues_ExpectNoError() { //------------Setup for test-------------------------- var act = new ViewPropertyBuilder() { }; //------------Execute Test--------------------------- Assert.IsNotNull(act); var keyValuePairs = act.BuildProperties(null, null, null); //------------Assert Results------------------------- Assert.AreEqual(0, keyValuePairs.Count); }
public void BuildProperties_GivenActionSourceTypeRegionRegionNullValues_ExpectNoError() { //------------Setup for test-------------------------- var act = new ViewPropertyBuilder() { }; IDbActionToolRegion <IDbAction> actionRegion = new DbActionRegion(); var sourceRegion = new Mock <ISourceToolRegion <IDbSource> >(); //------------Execute Test--------------------------- Assert.IsNotNull(act); var keyValuePairs = act.BuildProperties(actionRegion, sourceRegion.Object, string.Empty); //------------Assert Results------------------------- Assert.AreEqual(0, keyValuePairs.Count); }