コード例 #1
0
        private static void Run()
        {
            var largeStructTest = new LargeStructTest();

            largeStructTest.Run(1000000);

            var guidArrayTest = new GuidArrayTest();

            guidArrayTest.Run(30000);

            var guidTest = new GuidTest();

            guidTest.Run(1000000);
            var typicalPersonArrayTest = new TypicalPersonArrayTest();

            typicalPersonArrayTest.Run(1000);

            var typicalPersonTest = new TypicalPersonTest();

            typicalPersonTest.Run(100000);

            var typicalMessageArrayTest = new TypicalMessageArrayTest();

            typicalMessageArrayTest.Run(10000);

            var typicalMessageTest = new TypicalMessageTest();

            typicalMessageTest.Run(1000000);

            Console.ReadLine();
        }
コード例 #2
0
        public void SetGuidPrimaryKey()
        {
            GuidTest dataTest = new GuidTest();

            dataTest.es.Connection.Name = "GuidTest";

            switch (dataTest.es.Connection.ProviderMetadataKey)
            {
            case "esSqlCe":
            case "esSqlCe4":
                using (esTransactionScope scope = new esTransactionScope())
                {
                    string testGuid = "b3883c65-ff94-47c4-8b0c-76896bedd45a";
                    dataTest = new GuidTest();
                    dataTest.es.Connection.Name = "GuidTest";
                    dataTest.GuidKey            = new Guid(testGuid);
                    dataTest.Save();
                    Guid?tempKey = dataTest.GuidKey;
                    dataTest.MarkAsDeleted();
                    dataTest.Save();
                    Assert.AreEqual(testGuid, tempKey.Value.ToString());
                }
                break;

            default:
                Assert.Ignore("SqlCe only");
                break;
            }
        }
コード例 #3
0
        public void GuidDynamicQuery()
        {
            GuidTestCollection dataTestColl = new GuidTestCollection();

            dataTestColl.es.Connection.Name = "GuidTest";
            GuidTest dataTest = new GuidTest();

            dataTest.es.Connection.Name = "GuidTest";

            switch (dataTest.es.Connection.ProviderMetadataKey)
            {
            case "esSqlCe":
            case "esSqlCe4":
                using (esTransactionScope scope = new esTransactionScope())
                {
                    dataTest = new GuidTest();
                    dataTest.es.Connection.Name = "GuidTest";
                    dataTest.GuidKey            = Guid.NewGuid();
                    dataTest.Save();
                    Guid tempKey = dataTest.GuidKey.Value;

                    dataTestColl = new GuidTestCollection();
                    dataTestColl.es.Connection.Name = "GuidTest";
                    dataTestColl.Query.Where(dataTestColl.Query.GuidKey == tempKey);
                    dataTestColl.Query.Load();
                    Assert.AreEqual(1, dataTestColl.Count);

                    dataTest = new GuidTest();
                    dataTest.es.Connection.Name = "GuidTest";
                    Assert.IsTrue(dataTest.LoadByPrimaryKey(tempKey));
                    dataTest.MarkAsDeleted();
                    dataTest.Save();
                }
                break;

            default:
                Assert.Ignore("SqlCe only");
                break;
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: akkadotnet/Wire
        private static void Run()
        {
            var largeStructTest = new LargeStructTest();
            largeStructTest.Run(1000000);

            var guidArrayTest = new GuidArrayTest();
            guidArrayTest.Run(30000);

            var guidTest = new GuidTest();
            guidTest.Run(1000000);
            var typicalPersonArrayTest = new TypicalPersonArrayTest();
            typicalPersonArrayTest.Run(1000);

            var typicalPersonTest = new TypicalPersonTest();
            typicalPersonTest.Run(100000);

            var typicalMessageArrayTest = new TypicalMessageArrayTest();
            typicalMessageArrayTest.Run(10000);

            var typicalMessageTest = new TypicalMessageTest();
            typicalMessageTest.Run(1000000);

            Console.ReadLine();
        }