public void LoadTwiceDerivedDataContainerByID()
        {
            DataContainer actualContainer   = Provider.LoadDataContainer(DomainObjectIDs.Distributor2).LocatedObject;
            DataContainer expectedContainer = TestDataContainerObjectMother.CreateDistributor2DataContainer();

            DataContainerChecker checker = new DataContainerChecker();

            checker.Check(expectedContainer, actualContainer);
        }
        public void LoadDerivedDataContainerByID()
        {
            DataContainer actualContainer   = Provider.LoadDataContainer(DomainObjectIDs.Partner1).LocatedObject;
            DataContainer expectedContainer = TestDataContainerObjectMother.CreatePartner1DataContainer();

            DataContainerChecker checker = new DataContainerChecker();

            checker.Check(expectedContainer, actualContainer);
        }
示例#3
0
        public void LoadDataContainers_ByID()
        {
            var id = new ObjectID("ClassWithAllDataTypes", new Guid("{3F647D79-0CAF-4a53-BAA7-A56831F8CE2D}"));

            var actualContainer = Provider.LoadDataContainers(new[] { id }).ToArray()[0].LocatedObject;

            var expectedContainer = TestDataContainerObjectMother.CreateClassWithAllDataTypes1DataContainer();

            var checker = new DataContainerChecker();

            checker.Check(expectedContainer, actualContainer);
        }
        public void LoadDataContainerByID()
        {
            ObjectID id = new ObjectID(typeof(ClassWithAllDataTypes), new Guid("{3F647D79-0CAF-4a53-BAA7-A56831F8CE2D}"));

            DataContainer actualContainer = Provider.LoadDataContainer(id).LocatedObject;

            DataContainer expectedContainer = TestDataContainerObjectMother.CreateClassWithAllDataTypes1DataContainer();

            DataContainerChecker checker = new DataContainerChecker();

            checker.Check(expectedContainer, actualContainer);
        }
示例#5
0
        public void AllDataTypes()
        {
            var query = QueryFactory.CreateQueryFromConfiguration("QueryWithAllDataTypes");

            query.Parameters.Add("@boolean", false);
            query.Parameters.Add("@byte", (byte)85);
            query.Parameters.Add("@date", new DateTime(2005, 1, 1));
            query.Parameters.Add("@dateTime", new DateTime(2005, 1, 1, 17, 0, 0));
            query.Parameters.Add("@decimal", (decimal)123456.789);
            query.Parameters.Add("@doubleLowerBound", 987654D);
            query.Parameters.Add("@doubleUpperBound", 987655D);
            query.Parameters.Add("@enum", ClassWithAllDataTypes.EnumType.Value1);
            query.Parameters.Add("@flags", ClassWithAllDataTypes.FlagsType.Flag0 | ClassWithAllDataTypes.FlagsType.Flag2);
            query.Parameters.Add("@extensibleEnum", Color.Values.Red());
            query.Parameters.Add("@guid", new Guid("{236C2DCE-43BD-45ad-BDE6-15F8C05C4B29}"));
            query.Parameters.Add("@int16", (short)32767);
            query.Parameters.Add("@int32", 2147483647);
            query.Parameters.Add("@int64", 9223372036854775807L);
            query.Parameters.Add("@singleLowerBound", (float)6789);
            query.Parameters.Add("@singleUpperBound", (float)6790);
            query.Parameters.Add("@string", "abcdeföäü");
            query.Parameters.Add("@stringWithoutMaxLength",
                                 "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
            query.Parameters.Add("@binary", ResourceManager.GetImage1());

            query.Parameters.Add("@naBoolean", true);
            query.Parameters.Add("@naByte", (byte)78);
            query.Parameters.Add("@naDate", new DateTime(2005, 2, 1));
            query.Parameters.Add("@naDateTime", new DateTime(2005, 2, 1, 5, 0, 0));
            query.Parameters.Add("@naDecimal", 765.098m);
            query.Parameters.Add("@naDoubleLowerBound", 654321D);
            query.Parameters.Add("@naDoubleUpperBound", 654322D);
            query.Parameters.Add("@naEnum", ClassWithAllDataTypes.EnumType.Value2);
            query.Parameters.Add("@naFlags", ClassWithAllDataTypes.FlagsType.Flag1 | ClassWithAllDataTypes.FlagsType.Flag2);
            query.Parameters.Add("@naGuid", new Guid("{19B2DFBE-B7BB-448e-8002-F4DBF6032AE8}"));
            query.Parameters.Add("@naInt16", (short)12000);
            query.Parameters.Add("@naInt32", -2147483647);
            query.Parameters.Add("@naInt64", 3147483647L);
            query.Parameters.Add("@naSingleLowerBound", 12F);
            query.Parameters.Add("@naSingleUpperBound", 13F);

            query.Parameters.Add("@extensibleEnumWithNullValue", null);
            query.Parameters.Add("@naBooleanWithNullValue", null);
            query.Parameters.Add("@naByteWithNullValue", null);
            query.Parameters.Add("@naDateWithNullValue", null);
            query.Parameters.Add("@naDateTimeWithNullValue", null);
            query.Parameters.Add("@naDecimalWithNullValue", null);
            query.Parameters.Add("@naEnumWithNullValue", null);
            query.Parameters.Add("@naFlagsWithNullValue", null);
            query.Parameters.Add("@naDoubleWithNullValue", null);
            query.Parameters.Add("@naGuidWithNullValue", null);
            query.Parameters.Add("@naInt16WithNullValue", null);
            query.Parameters.Add("@naInt32WithNullValue", null);
            query.Parameters.Add("@naInt64WithNullValue", null);
            query.Parameters.Add("@naSingleWithNullValue", null);
            query.Parameters.Add("@stringWithNullValue", null);
            query.Parameters.Add("@nullableBinaryWithNullValue", null);

            var actualContainers = Provider.ExecuteCollectionQuery(query).ToArray();

            Assert.That(actualContainers, Is.Not.Null);
            Assert.That(actualContainers.Length, Is.EqualTo(1));

            DataContainer expectedContainer = TestDataContainerObjectMother.CreateClassWithAllDataTypes1DataContainer();
            var           checker           = new DataContainerChecker();

            checker.Check(expectedContainer, actualContainers[0]);
        }