Пример #1
0
        private static void CheckEnums(List <EnumerationData> enums, TypeSet t, Action CheckContents, ref ParameterType modifiedType, bool hidden)
        {
            EnumerationData Enumeration1 = new EnumerationData("enum1", ParameterType.Parse(hidden ? "e25f2768-ac00-4320-a558-12b51d85d771" : "f70fb4d1-59f5-4618-9bc4-8da19f943da2"), new[] { new EnumerationData.Element("value1", Guid.Parse("9ee98b1e-fb29-42c5-8a26-903a8aecacc0")),
                                                                                                                                                                                               new EnumerationData.Element("value2", Guid.Parse("a3ed3b47-9985-4f17-b791-4155cc7196f4")) });
            EnumerationData Enumeration2 = new EnumerationData("enum2", ParameterType.Parse(hidden ? "19bf99ff-98f2-4ab3-96d6-1f7e61d98ae7" : "a532c7c0-2806-4def-9fb2-5182b6803cbe"), new[] { new EnumerationData.Element("value1", Guid.Parse("e80fd4c3-eb10-4309-b683-79c3675b6fb8")),
                                                                                                                                                                                               new EnumerationData.Element("value2", Guid.Parse("c0b0a09e-4825-479e-87dc-599bdacf045f")) });
            EnumerationData Enumeration3 = new EnumerationData("enum3", ParameterType.Parse(hidden ? "b78e53cd-717b-446f-9ab2-fbbf5c41b067" : "aa274a73-95c1-4272-bb23-9c9cabeb183e"), new[] { new EnumerationData.Element("asd", Guid.Parse("27b59086-7e9b-4b7f-8796-a7a23eb727c1")),
                                                                                                                                                                                               new EnumerationData.Element("sdasd", Guid.Parse("b08cf9e0-9d77-42cf-9f1c-a21def2b79d3")),
                                                                                                                                                                                               new EnumerationData.Element("sdasd2", Guid.Parse("4f73eaad-86fe-4cbb-adbc-016724399ae5")) });

            var a = Enumeration1;

            t.AddEnum(a, hidden);
            enums.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Enumeration2;
            t.AddEnum(a, hidden);
            enums.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Enumeration1;
            t.Remove(a.TypeId);
            enums.Remove(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Enumeration3;
            t.AddEnum(a, hidden);
            enums.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            EnumerationData Enum2Replacement = new EnumerationData("repeat", Enumeration2.TypeId, new[] { new EnumerationData.Element("asd", Guid.Parse("24be3852-b34f-4f20-ab72-3e391e939872")) });

            t.ModifyEnum(Enum2Replacement);
            enums[enums.IndexOf(Enumeration2)] = Enum2Replacement;
            Assert.That(modifiedType, Is.EqualTo(Enum2Replacement.TypeId));
            modifiedType = null;
            CheckContents();

            EnumerationData Enumeration3Replacement = new EnumerationData("enum3 replacement", Enumeration3.TypeId, new[] { new EnumerationData.Element("asd", Guid.Parse("27b59086-7e9b-4b7f-8796-a7a23eb727c1")),
                                                                                                                            new EnumerationData.Element("sdasd", Guid.Parse("b08cf9e0-9d77-42cf-9f1c-a21def2b79d3")),
                                                                                                                            new EnumerationData.Element("sdasd2", Guid.Parse("4f73eaad-86fe-4cbb-adbc-016724399ae5")) });

            t.RenameType(Enumeration3.TypeId, Enumeration3Replacement.Name);
            enums[enums.IndexOf(Enumeration3)] = Enumeration3Replacement;
            Assert.That(modifiedType, Is.EqualTo(Enumeration3Replacement.TypeId));
            modifiedType = null;
            CheckContents();
        }
Пример #2
0
        private static void CheckDecimals(List <DecimalData> decimals, TypeSet t, Action CheckContents, ref ParameterType modifiedType)
        {
            DecimalData Decimal1 = new DecimalData("decimal1", ParameterType.Parse("feea56b3-d51b-4c60-bb81-96c6e543e096"), 12, -1);
            DecimalData Decimal2 = new DecimalData("decimal2", ParameterType.Parse("1275ba4a-ff58-492c-ae6f-9e915eefb796"), 15, -1);
            DecimalData Decimal3 = new DecimalData("decimal3", ParameterType.Parse("729e3aa4-ce76-4dbd-95b8-549dbdec035a"), -123, -1231);

            var a = Decimal1;

            t.AddDecimal(a);
            decimals.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Decimal2;
            t.AddDecimal(a);
            decimals.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Decimal1;
            t.Remove(a.TypeId);
            decimals.Remove(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Decimal3;
            t.AddDecimal(a);
            decimals.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            DecimalData Decimal2Replacement = new DecimalData("decimal 2 replacement", ParameterType.Parse("1275ba4a-ff58-492c-ae6f-9e915eefb796"), 345, -345);

            t.ModifyDecimal(Decimal2Replacement);
            decimals[decimals.IndexOf(Decimal2)] = Decimal2Replacement;
            Assert.That(modifiedType, Is.EqualTo(Decimal2Replacement.TypeId));
            modifiedType = null;
            CheckContents();

            DecimalData Decimal3Replacement = new DecimalData("Decimal3Replaced", ParameterType.Parse("729e3aa4-ce76-4dbd-95b8-549dbdec035a"), -123, -1231);

            t.RenameType(Decimal3.TypeId, Decimal3Replacement.Name);
            decimals[decimals.IndexOf(Decimal3)] = Decimal3Replacement;
            Assert.That(modifiedType, Is.EqualTo(Decimal3Replacement.TypeId));
            modifiedType = null;
            CheckContents();
        }
Пример #3
0
        private static void CheckLocalizedStrings(List <LocalizedStringData> localizedStrings, TypeSet t, Action CheckContents, ref ParameterType modifiedType)
        {
            LocalizedStringData string1 = new LocalizedStringData("string1", ParameterType.Parse("03d7b9f3-cc7e-4639-b809-20f92860c041"));
            LocalizedStringData string2 = new LocalizedStringData("repeat", ParameterType.Parse("3f0af919-8c61-4863-9039-9d4b59a2b2e6"));
            LocalizedStringData string3 = new LocalizedStringData("repeat", ParameterType.Parse("3771aec9-a2ea-4f06-a426-fb245de56199"));

            var a = string1;

            t.AddLocalizedString(a);
            localizedStrings.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = string2;
            t.AddLocalizedString(a);
            localizedStrings.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = string1;
            t.Remove(a.TypeId);
            localizedStrings.Remove(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = string3;
            t.AddLocalizedString(a);
            localizedStrings.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            LocalizedStringData string2Replacement = new LocalizedStringData("string2 replacement", string2.TypeId);

            t.ModifyLocalizedString(string2Replacement);
            localizedStrings[localizedStrings.IndexOf(string2)] = string2Replacement;
            Assert.That(modifiedType, Is.EqualTo(string2Replacement.TypeId));
            modifiedType = null;
            CheckContents();

            LocalizedStringData string3Replacement = new LocalizedStringData("replacement string 3", string3.TypeId);

            t.RenameType(string3.TypeId, string3Replacement.Name);
            localizedStrings[localizedStrings.IndexOf(string3)] = string3Replacement;
            Assert.That(modifiedType, Is.EqualTo(string3Replacement.TypeId));
            modifiedType = null;
            CheckContents();
        }
Пример #4
0
        private static void CheckIntegers(List <IntegerData> integers, TypeSet t, Action CheckContents, ref ParameterType modifiedType)
        {
            IntegerData Integer1 = new IntegerData("int1", ParameterType.Parse("e051bfd8-d9d8-4f14-bd39-0ec1a9e9073b"), 456, 123);
            IntegerData Integer2 = new IntegerData("repeat", ParameterType.Parse("4427eb13-e799-4959-86a8-31a2dbd71b03"), 456, 123);
            IntegerData Integer3 = new IntegerData("repeat", ParameterType.Parse("e8aa3cef-8b60-4b08-bb8d-e0a9b2a2085e"), 1, 0);

            var a = Integer1;

            t.AddInteger(a);
            integers.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Integer2;
            t.AddInteger(a);
            integers.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Integer1;
            t.Remove(a.TypeId);
            integers.Remove(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            a = Integer3;
            t.AddInteger(a);
            integers.Add(a);
            Assert.That(modifiedType, Is.EqualTo(a.TypeId));
            modifiedType = null;
            CheckContents();

            IntegerData Integer2Replacement = new IntegerData("Integer2 replacement", ParameterType.Parse("4427eb13-e799-4959-86a8-31a2dbd71b03"), 234, -234);

            t.ModifyInteger(Integer2Replacement);
            integers[integers.IndexOf(Integer2)] = Integer2Replacement;
            Assert.That(modifiedType, Is.EqualTo(Integer2Replacement.TypeId));
            modifiedType = null;
            CheckContents();

            IntegerData Integer3Replacement = new IntegerData("replacement integer 3", ParameterType.Parse("e8aa3cef-8b60-4b08-bb8d-e0a9b2a2085e"), 1, 0);

            t.RenameType(Integer3.TypeId, Integer3Replacement.Name);
            integers[integers.IndexOf(Integer3)] = Integer3Replacement;
            Assert.That(modifiedType, Is.EqualTo(Integer3Replacement.TypeId));
            modifiedType = null;
            CheckContents();
        }
Пример #5
0
        private static void CheckLocalDynamicEnums(List <LocalDynamicEnumerationData> dynamicEnums, TypeSet t, Action CheckContents, ref ParameterType modifiedType)
        {
            LocalDynamicEnumerationData DE1 = new LocalDynamicEnumerationData("DE1", ParameterType.Parse("5200fb71-c373-457b-be1d-e11b45ce9d9a"));
            LocalDynamicEnumerationData DE2 = new LocalDynamicEnumerationData("DE2", ParameterType.Parse("ad9e7fd8-a86b-4059-b28a-697774aa3b63"));
            LocalDynamicEnumerationData DE3 = new LocalDynamicEnumerationData("DE3", ParameterType.Parse("f29f7131-e6b7-439b-b1cd-e09a6e1b9897"));

            t.AddLocalDynamicEnum(DE1);
            dynamicEnums.Add(DE1);
            Assert.That(modifiedType, Is.EqualTo(DE1.TypeId));
            modifiedType = null;
            CheckContents();

            t.Remove(DE1.TypeId);
            dynamicEnums.Remove(DE1);
            Assert.That(modifiedType, Is.EqualTo(DE1.TypeId));
            modifiedType = null;
            CheckContents();

            t.AddLocalDynamicEnum(DE2);
            dynamicEnums.Add(DE2);
            Assert.That(modifiedType, Is.EqualTo(DE2.TypeId));
            modifiedType = null;
            CheckContents();

            t.AddLocalDynamicEnum(DE3);
            dynamicEnums.Add(DE3);
            Assert.That(modifiedType, Is.EqualTo(DE3.TypeId));
            modifiedType = null;
            CheckContents();

            LocalDynamicEnumerationData DE3Modified = new LocalDynamicEnumerationData("DE3Modified", ParameterType.Parse("f29f7131-e6b7-439b-b1cd-e09a6e1b9897"));

            t.RenameType(DE3.TypeId, DE3Modified.Name);
            dynamicEnums[dynamicEnums.IndexOf(DE3)] = DE3Modified;
            Assert.That(modifiedType, Is.EqualTo(DE3Modified.TypeId));
            modifiedType = null;
            CheckContents();
        }
Пример #6
0
        private static void CheckDynamicEnums(List <DynamicEnumerationData> dynamicEnums, TypeSet t, Action CheckContents, ref ParameterType modifiedType)
        {
            DynamicEnumerationData DE1 = new DynamicEnumerationData("DE1", ParameterType.Parse("89e54648-0572-4de2-82a6-3cdf5ea8aebc"));
            DynamicEnumerationData DE2 = new DynamicEnumerationData("DE2", ParameterType.Parse("17b8ce6a-da16-459e-ab58-c77f62c5eba4"));
            DynamicEnumerationData DE3 = new DynamicEnumerationData("DE3", ParameterType.Parse("882d169d-b697-4ff3-8f4d-d0a3b18549c7"));

            t.AddDynamicEnum(DE1);
            dynamicEnums.Add(DE1);
            Assert.That(modifiedType, Is.EqualTo(DE1.TypeId));
            modifiedType = null;
            CheckContents();

            t.Remove(DE1.TypeId);
            dynamicEnums.Remove(DE1);
            Assert.That(modifiedType, Is.EqualTo(DE1.TypeId));
            modifiedType = null;
            CheckContents();

            t.AddDynamicEnum(DE2);
            dynamicEnums.Add(DE2);
            Assert.That(modifiedType, Is.EqualTo(DE2.TypeId));
            modifiedType = null;
            CheckContents();

            t.AddDynamicEnum(DE3);
            dynamicEnums.Add(DE3);
            Assert.That(modifiedType, Is.EqualTo(DE3.TypeId));
            modifiedType = null;
            CheckContents();

            DynamicEnumerationData DE3Modified = new DynamicEnumerationData("DE3Modified", ParameterType.Parse("882d169d-b697-4ff3-8f4d-d0a3b18549c7"));

            t.RenameType(DE3.TypeId, DE3Modified.Name);
            dynamicEnums[dynamicEnums.IndexOf(DE3)] = DE3Modified;
            Assert.That(modifiedType, Is.EqualTo(DE3Modified.TypeId));
            modifiedType = null;
            CheckContents();
        }