示例#1
0
        public string AddOrganization(Organization organization)
        {
            organization.Identifier = ConstantStrings.OrganizationIdPrefix + _Organizations.Count();

            _Organizations.Add(organization);

            return organization.Identifier;
        }
示例#2
0
        public void AddOrganizationTest()
        {
            var organizations = new Organizations();
            var organization = new Organization { Identifier = "organization1", Title = "Title" };

            ManifestManager.AddOrganization(organizations, organization);

            var org = organizations.OrganizationsList.Single(i => i.Title == "Title");
            Assert.AreEqual("organization1", org.Identifier);
        }
示例#3
0
        public void Organizationtest()
        {
            var organization = new Organization();

            var completionThreshhold = new CompletionThreshold
                {
                   CompletedByMeasure = true, MinProgressMeasure = 0, ProgressWeight = 1 
                };
            organization.CompletionThreshold = completionThreshhold;
            organization.Identifier = "id";
            organization.Items.Add(
                new Item("res id")
                    {
                        CompletionThreshold = completionThreshhold, 
                        Data =
                            new List<Map>(
                            new[] { new Map { ReadSharedData = false, TargetID = "target id", WriteSharedData = false } })
                    });
            organization.Items = new List<Item>();
            organization.Items.Add(new Item("123"));
            organization.Items.Add(new Item());
            organization.Metadata = new Metadata();
            organization.ObjectivesGlobalToSystem = organization.Items[1].IsParent;
            organization.Sequencing = new Sequencing();
            organization.SharedDataGlobalToSystem = true;
            organization.Structure = "structure";
            organization.Title = "title";

            var manifest = new Manifest();
            manifest.Organizations.AddOrganization(organization);
            manifest.Organizations.Default = "def";

            var path = Path.Combine(this.root, "organization.xml");
            manifest.Serialize(new StreamWriter(path));
            Assert.IsTrue(File.Exists(path));
        }
示例#4
0
 public static Organizations AddOrganization(Organizations organizations, Organization organization)
 {
     organizations._Organizations.Add(organization);
     return organizations;
 }