Пример #1
0
        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);
        }
Пример #2
0
        public void LinkTypeTest()
        {
            ConfigurationV2 target = new ConfigurationV2();

            Assert.AreEqual(target.LinkType, default(string));
            target.LinkType = "link type";
            Assert.AreEqual(target.LinkType, "link type");
        }
Пример #3
0
        public void ColumnSummaryFieldNameTest()
        {
            ConfigurationV2 target = new ConfigurationV2();

            Assert.AreEqual(target.ColumnSummaryFieldName, default(string));
            target.ColumnSummaryFieldName = "column";
            Assert.AreEqual(target.ColumnSummaryFieldName, "column");
        }
Пример #4
0
        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");
        }
Пример #5
0
        public void RowSummaryFieldNameTest()
        {
            ConfigurationV2 target = new ConfigurationV2();

            Assert.AreEqual(target.RowSummaryFieldName, default(string));
            target.RowSummaryFieldName = "row";
            Assert.AreEqual(target.RowSummaryFieldName, "row");
        }
Пример #6
0
        public void ReportIdTest()
        {
            ConfigurationV2 target = new ConfigurationV2();

            Assert.AreEqual(target.ReportId, default(string));
            target.ReportId = "reportID";
            Assert.AreEqual(target.ReportId, "reportID");
        }
Пример #7
0
        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");
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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");
        }
Пример #13
0
        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");
        }
Пример #14
0
        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");
        }
Пример #15
0
        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);
        }
Пример #16
0
        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
        }
Пример #17
0
        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);
        }
Пример #18
0
        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");
        }
Пример #19
0
        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;
            }
        }
Пример #20
0
        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);
        }
Пример #21
0
 public void ConfigurationV2ConstructorTest()
 {
     ConfigurationV2 target = new ConfigurationV2();
     // Tested in other methods
 }