Exemple #1
0
        public async Task AuthenticationInfos_TestAsync()
        {
            var dataBase = await dataBaseContext.GetRandomDataBaseAsync();

            var infos = await dataBase.Dispatcher.InvokeAsync(() => dataBase.AuthenticationInfos);

            Assert.IsNotNull(infos);
        }
        public async Task AddNewDataBaseAsync_Arg1_Exists_TestAsync()
        {
            var authentication = await this.TestContext.LoginRandomAsync(Authority.Admin);

            var dataBase = await dataBaseContext.GetRandomDataBaseAsync();

            var dataBaseName = dataBase.Name;
            var comment      = RandomUtility.NextString();
            await dataBaseContext.AddNewDataBaseAsync(authentication, dataBaseName, comment);
        }
        public static async Task ClassInitAsync(TestContext context)
        {
            app = new TestApplication();
            await app.InitializeAsync(context);

            await app.OpenAsync();

            authentication = await app.LoginRandomAsync(Authority.Admin);

            dataBaseContext = app.GetService(typeof(IDataBaseContext)) as IDataBaseContext;
            dataBase        = await dataBaseContext.GetRandomDataBaseAsync(DataBaseFlags.NotLoaded | DataBaseFlags.Public | DataBaseFlags.NotLocked);

            await dataBase.LoadAsync(authentication);

            await dataBase.EnterAsync(authentication);

            await dataBase.InitializeRandomItemsAsync(authentication, DataBaseSettings.Default);

            category = await dataBase.GetRandomTableCategoryAsync(item => item.Parent != null);
        }
Exemple #4
0
        //[TestMethod]
        public async Task GenerateStandardTestAsync()
        {
            var authentication = await this.TestContext.LoginRandomAsync(Authority.Member);

            var dataBase = await dataBaseContext.GetRandomDataBaseAsync(DataBaseFlags.Loaded | DataBaseFlags.Public | DataBaseFlags.NotLocked);

            await dataBase.EnterAsync(authentication);

            try
            {
                var transaction = await dataBase.BeginTransactionAsync(authentication);

                await dataBase.GenerateStandardAsync(authentication);

                await transaction.CommitAsync(authentication);
            }
            finally
            {
                await dataBase.LeaveAsync(authentication);
            }
        }