private ConfigurationV2 CreateConfiguration() { ConfigurationV2 target = new ConfigurationV2(); target.TeamProjectCollection = "TeamProjectCollection"; target.TeamProject = "TeamProject"; target.ChildItems.Add("ChildItems"); target.BacklogItems.Add("BacklogItems"); target.States.Add(new CustomState { Name = "States" }); target.SortFieldName = "SortFieldName"; target.SortDirection = SortDirection.Ascending; target.RowSummaryFieldName = "RowSummaryFieldName"; target.ColumnSummaryFieldName = "ColumnSummaryFieldName"; target.LinkType = "LinkType"; target.QueryId = Guid.Empty; target.ReportId = "ReportId"; target.ReportParameters.Add(new ReportParameter { Name = "Report Parameter" }); target.IsAutoRefreshChecked = true; target.AutoRefreshDelay = 15; return(target); }
public void LinkTypeTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.LinkType, default(string)); target.LinkType = "link type"; Assert.AreEqual(target.LinkType, "link type"); }
public void ColumnSummaryFieldNameTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.ColumnSummaryFieldName, default(string)); target.ColumnSummaryFieldName = "column"; Assert.AreEqual(target.ColumnSummaryFieldName, "column"); }
public void SortFieldNameTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.SortFieldName, default(string)); target.SortFieldName = "sort field name"; Assert.AreEqual(target.SortFieldName, "sort field name"); }
public void RowSummaryFieldNameTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.RowSummaryFieldName, default(string)); target.RowSummaryFieldName = "row"; Assert.AreEqual(target.RowSummaryFieldName, "row"); }
public void ReportIdTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.ReportId, default(string)); target.ReportId = "reportID"; Assert.AreEqual(target.ReportId, "reportID"); }
public void TeamProjectCollectionTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.TeamProject, default(string)); target.TeamProject = "team project collection"; Assert.AreEqual(target.TeamProject, "team project collection"); }
public void SortDirectionTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.SortDirection, default(SortDirection)); target.SortDirection = SortDirection.Ascending; Assert.AreEqual(target.SortDirection, SortDirection.Ascending); target.SortDirection = SortDirection.Descending; Assert.AreEqual(target.SortDirection, SortDirection.Descending); }
public void IsAutoRefreshCheckedTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.IsAutoRefreshChecked, false); // false shlould be default value target.IsAutoRefreshChecked = false; Assert.AreEqual(target.IsAutoRefreshChecked, false); target.IsAutoRefreshChecked = true; Assert.AreEqual(target.IsAutoRefreshChecked, true); }
public void AutoRefreshDelayTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.AutoRefreshDelay, 30); // 30 should be default value target.AutoRefreshDelay = 0; Assert.AreEqual(target.AutoRefreshDelay, 0); target.AutoRefreshDelay = 10; Assert.AreEqual(target.AutoRefreshDelay, 10); }
public void QueryIdTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.AreEqual(target.QueryId, default(Guid)); target.QueryId = Guid.Empty; Assert.AreEqual(target.QueryId, Guid.Empty); Guid guid = new Guid(); target.QueryId = guid; Assert.AreEqual(target.QueryId, guid); }
public void ChildItemsTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.IsNotNull(target.ChildItems); target.ChildItems.Add("s1"); target.ChildItems.Add("s2"); target.ChildItems.Add("s3"); Assert.AreEqual(target.ChildItems.Count, 3); Assert.AreEqual(target.ChildItems[0], "s1"); Assert.AreEqual(target.ChildItems[1], "s2"); Assert.AreEqual(target.ChildItems[2], "s3"); }
public void StatesTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.IsNotNull(target.States); target.States.Add(new CustomState() { Name = "name 1" }); target.States.Add(new CustomState() { Name = "name 2" }); Assert.AreEqual(target.States.Count, 2); Assert.AreEqual(target.States[0].Name, "name 1"); Assert.AreEqual(target.States[1].Name, "name 2"); }
public void ReportParametersTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.IsNotNull(target.ReportParameters); target.ReportParameters.Add(new ReportParameter() { Name = "report0" }); target.ReportParameters.Add(new ReportParameter() { Name = "report1" }); Assert.AreEqual(target.ReportParameters.Count, 2); Assert.AreEqual(target.ReportParameters[0].Name, "report0"); Assert.AreEqual(target.ReportParameters[1].Name, "report1"); }
public void IsAssociatedWithTeamProjectTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.IsFalse(target.IsAssociatedWithTeamProject); target.TeamProject = null; target.TeamProjectCollection = null; Assert.IsFalse(target.IsAssociatedWithTeamProject); target.TeamProject = "some"; target.TeamProjectCollection = null; Assert.IsFalse(target.IsAssociatedWithTeamProject); target.TeamProject = null; target.TeamProjectCollection = "thing"; Assert.IsFalse(target.IsAssociatedWithTeamProject); target.TeamProject = "some"; target.TeamProjectCollection = "thing"; Assert.IsTrue(target.IsAssociatedWithTeamProject); }
public void CopyFromConfigurationOld1Test() { Configuration target = new Configuration(); target.TeamProjectCollection = "TeamProjectCollection"; target.TeamProject = "TeamProject"; target.ChildItems.Add("ChildItems"); target.BacklogItems.Add("BacklogItems"); target.States.Add(new CustomState { Name = "States" }); target.SortFieldName = "SortFieldName"; target.SortDirection = SortDirection.Ascending; target.RowSummaryFieldName = "RowSummaryFieldName"; target.ColumnSummaryFieldName = "ColumnSummaryFieldName"; target.LinkType = "LinkType"; target.QueryId = Guid.Empty; target.ReportId = "ReportId"; target.ReportParameters.Add(new ReportParameter { Name = "Report Parameter" }); ConfigurationV2 copy = new ConfigurationV2(); copy.CopyFromConfigurationOld1(target); Assert.AreEqual(copy.TeamProjectCollection, "TeamProjectCollection"); Assert.AreEqual(copy.TeamProject, "TeamProject"); Assert.AreEqual(copy.ChildItems[0], "ChildItems"); Assert.AreEqual(copy.BacklogItems[0], "BacklogItems"); Assert.AreEqual(copy.States[0].Name, "States"); Assert.AreEqual(copy.SortFieldName, "SortFieldName"); Assert.AreEqual(copy.SortDirection, SortDirection.Ascending); Assert.AreEqual(copy.RowSummaryFieldName, "RowSummaryFieldName"); Assert.AreEqual(copy.ColumnSummaryFieldName, "ColumnSummaryFieldName"); Assert.AreEqual(copy.LinkType, "LinkType"); Assert.AreEqual(copy.QueryId, Guid.Empty); Assert.AreEqual(copy.ReportId, "ReportId"); Assert.AreEqual(copy.ReportParameters[0].Name, "Report Parameter"); Assert.AreEqual(copy.IsAutoRefreshChecked, false); //default value Assert.AreEqual(copy.AutoRefreshDelay, 30); // default value }
public void TestSerializationDeserializationV2() { ConfigurationV2 target = new ConfigurationV2(); target = CreateConfiguration(); string serializedTarget = target.SerializeAsString(); ConfigurationV2 copy = ConfigurationV2.DeserializeFromString(serializedTarget) as ConfigurationV2; Assert.AreEqual(copy.TeamProjectCollection, "TeamProjectCollection"); Assert.AreEqual(copy.TeamProject, "TeamProject"); Assert.AreEqual(copy.ChildItems[0], "ChildItems"); Assert.AreEqual(copy.BacklogItems[0], "BacklogItems"); Assert.AreEqual(copy.States[0].Name, "States"); Assert.AreEqual(copy.SortFieldName, "SortFieldName"); Assert.AreEqual(copy.SortDirection, SortDirection.Ascending); Assert.AreEqual(copy.RowSummaryFieldName, "RowSummaryFieldName"); Assert.AreEqual(copy.ColumnSummaryFieldName, "ColumnSummaryFieldName"); Assert.AreEqual(copy.LinkType, "LinkType"); Assert.AreEqual(copy.QueryId, Guid.Empty); Assert.AreEqual(copy.ReportId, "ReportId"); Assert.AreEqual(copy.ReportParameters[0].Name, "Report Parameter"); Assert.AreEqual(copy.IsAutoRefreshChecked, true); Assert.AreEqual(copy.AutoRefreshDelay, 15); }
public void InternalStatesTest() { ConfigurationV2 target = new ConfigurationV2(); Assert.IsNotNull(target.InternalStates); target.States.Add(new CustomState() { Name = "name 1" }); target.States.Add(new CustomState() { Name = "name 2" }); Assert.AreEqual(target.InternalStates.Count, 2); Assert.AreEqual(target.InternalStates[0].Name, "name 1"); Assert.AreEqual(target.InternalStates[1].Name, "name 2"); List <CustomState> list = target.InternalStates; target.InternalStates = new List <CustomState>(); target.InternalStates = list; Assert.AreEqual(target.InternalStates.Count, 2); Assert.AreEqual(target.InternalStates[0].Name, "name 1"); Assert.AreEqual(target.InternalStates[1].Name, "name 2"); }
public async Task Execute(IUserLoadTestHttpClient loadLoadTestHttpClient) { var test = new ConfigurationV2(loadLoadTestHttpClient, _tenant, "AMC", "Wood Door v1") .WithIntegrationParameter("CurrencyCode", "", "string") .WithIntegrationParameter("ExchangeRate", "1", "number"); try { await test.StartAsync(); await test.ConfigureWithRandomOptionAsync("Select your wood species:", new string[] { }, "Species"); await test.ConfigureWithRandomOptionAsync("Stain Color:", new string[] { }, "Stain"); await test.Continue(); await test.ConfigureAsync("Door Style:", "AA", "Set Style"); await test.ConfigureAsync("Width:", "28", "Width"); await test.ConfigureAsync("Height:", "84", "Height"); await test.ConfigureAsync("Hinges:", "True", "Hinges"); await test.Finalize(); Console.WriteLine("Success"); } catch (System.Exception e) { Console.WriteLine($"FAILED {e.Message}"); await test.Cancel(); //throw e; } }
public void CloneTest() { ConfigurationV2 target = new ConfigurationV2(); target = CreateConfiguration(); ConfigurationV2 clone = target.Clone() as ConfigurationV2; Assert.AreEqual(target.TeamProjectCollection, "TeamProjectCollection"); Assert.AreEqual(target.TeamProject, "TeamProject"); Assert.AreEqual(target.ChildItems[0], "ChildItems"); Assert.AreEqual(target.BacklogItems[0], "BacklogItems"); Assert.AreEqual(target.States[0].Name, "States"); Assert.AreEqual(target.SortFieldName, "SortFieldName"); Assert.AreEqual(target.SortDirection, SortDirection.Ascending); Assert.AreEqual(target.RowSummaryFieldName, "RowSummaryFieldName"); Assert.AreEqual(target.ColumnSummaryFieldName, "ColumnSummaryFieldName"); Assert.AreEqual(target.LinkType, "LinkType"); Assert.AreEqual(target.QueryId, Guid.Empty); Assert.AreEqual(target.ReportId, "ReportId"); Assert.AreEqual(target.ReportParameters[0].Name, "Report Parameter"); Assert.AreEqual(target.IsAutoRefreshChecked, true); Assert.AreEqual(target.AutoRefreshDelay, 15); }
public void ConfigurationV2ConstructorTest() { ConfigurationV2 target = new ConfigurationV2(); // Tested in other methods }