Exemplo n.º 1
0
        public void ProjectDetails_ToString_ReturnCorrectlyFormatedValue()
        {
            string projectId         = "projectId";
            string projectName       = "projectName";
            string projectHref       = "projectHref";
            string projectWebUrl     = "projectWebUrl";
            bool   isProjectArchived = true;
            ProjectConfigurationsList configurationsList = new ProjectConfigurationsList
            {
                Configurations = new List <ProjectConfiguration>()
            };

            string expectedResult = string.Format(
                "ProjectId: {0}, ProjectName: {1}, ProjectHref: {2}, ProjectWebUrl: {3}, IsProjectArchived: {4}, ConfigurationsCount: {5}",
                projectId,
                projectName,
                projectHref,
                projectWebUrl,
                isProjectArchived,
                configurationsList != null && configurationsList.Configurations != null ? configurationsList.Configurations.Count : 0);

            var projectDetails = new ProjectDetails
            {
                ProjectId          = projectId,
                ProjectName        = projectName,
                ProjectHref        = projectHref,
                ProjectWebUrl      = projectWebUrl,
                IsProjectArchived  = isProjectArchived,
                ConfigurationsList = configurationsList
            };

            Assert.AreEqual(expectedResult, projectDetails.ToString());
        }
Exemplo n.º 2
0
        public void ProjectConfigurationsList_ToString_ReturnCorrectlyFormatedValue()
        {
            List <ProjectConfiguration> configurations = new List <ProjectConfiguration>();
            string expectedResult = string.Format("ConfigurationsCount: {0}", configurations != null ? configurations.Count : 0);

            var projectConfigurationsList = new ProjectConfigurationsList
            {
                Configurations = configurations
            };

            Assert.AreEqual(expectedResult, projectConfigurationsList.ToString());
        }