コード例 #1
0
        internal static ZumoTestGroup CreateTests()
        {
            ZumoTestGroup result = new ZumoTestGroup("Offline tests");

            result.AddTest(CreateClearStoreTest());

            result.AddTest(CreateBasicTest());
            result.AddTest(CreateSyncConflictTest(true));
            result.AddTest(CreateSyncConflictTest(false));

            result.AddTest(CreateAbortPushDuringSyncTest(whereToAbort: SyncAbortLocation.Start));
            result.AddTest(CreateAbortPushDuringSyncTest(whereToAbort: SyncAbortLocation.Middle));
            result.AddTest(CreateAbortPushDuringSyncTest(whereToAbort: SyncAbortLocation.End));

            result.AddTest(ZumoLoginTests.CreateLogoutTest());
            result.AddTest(CreateSyncTestForAuthenticatedTable(false));
            result.AddTest(ZumoLoginTests.CreateLoginTest(MobileServiceAuthenticationProvider.Facebook));
            var noOptimisticConcurrencyTest = CreateNoOptimisticConcurrencyTest();

            noOptimisticConcurrencyTest.CanRunUnattended = false;
            result.AddTest(noOptimisticConcurrencyTest);
            result.AddTest(CreateSyncTestForAuthenticatedTable(true));
            result.AddTest(ZumoLoginTests.CreateLogoutTest());

            return(result);
        }
コード例 #2
0
        internal static ZumoTestGroup CreateTests()
        {
            ZumoTestGroup result = new ZumoTestGroup("Custom API tests");

            DateTime now    = DateTime.UtcNow;
            int      seed   = now.Year * 10000 + now.Month * 100 + now.Day;
            Random   rndGen = new Random(seed);

#if !NET45
            result.AddTest(ZumoLoginTests.CreateLogoutTest());
#endif

            result.AddTest(CreateHttpContentApiTest(DataFormat.Xml, DataFormat.Json, rndGen));

#if !NET45
            List <ZumoTest> testsWhichNeedAuth = new List <ZumoTest>();

            foreach (ApiPermissions apiPermission in Util.EnumGetValues(typeof(ApiPermissions)))
            {
                testsWhichNeedAuth.Add(CreateJTokenApiTest(apiPermission, false, rndGen));
            }

            testsWhichNeedAuth.Add(ZumoLoginTests.CreateLoginTest(MobileServiceAuthenticationProvider.Google));
            testsWhichNeedAuth.Add(CreateJTokenApiTest(ApiPermissions.User, true, rndGen));
            testsWhichNeedAuth.Add(ZumoLoginTests.CreateLogoutTest());

            foreach (var test in testsWhichNeedAuth)
            {
                test.CanRunUnattended = false;
                result.AddTest(test);
            }
#endif

            foreach (DataFormat inputFormat in Util.EnumGetValues(typeof(DataFormat)))
            {
                foreach (DataFormat outputFormat in Util.EnumGetValues(typeof(DataFormat)))
                {
                    result.AddTest(CreateHttpContentApiTest(inputFormat, outputFormat, rndGen));
                }
            }


            result.AddTest(ZumoQueryTests.CreatePopulateTableTest());
            foreach (TypedTestType testType in Util.EnumGetValues(typeof(TypedTestType)))
            {
                result.AddTest(CreateTypedApiTest(rndGen, testType));
            }

            return(result);
        }