public async Task TestDeleteNotExistAppAsync() { await Utils.SetDefaultValueDbContextAsync(); BotDbContext db = Utils.CreateMemoryDbContext(); Guid clientId1 = Guid.NewGuid(); await db.DisposeAsync(); db = Utils.CreateMemoryDbContext(); BindHandler bindHandler = new BindHandler(db, null); string _ = await bindHandler.DeleteAppAsync(clientId1.ToString()); }
public async Task TestDeleteAppAsync() { await Utils.SetDefaultValueDbContextAsync(); BotDbContext db = Utils.CreateMemoryDbContext(); Guid clientId1 = await db.AzureApps.AsQueryable().Select(app => app.Id).FirstAsync(); await db.DisposeAsync(); db = Utils.CreateMemoryDbContext(); BindHandler bindHandler = new BindHandler(db, null); string deleteUrl = await bindHandler.DeleteAppAsync(clientId1.ToString()); Assert.AreEqual(deleteUrl, string.Format(BindHandler.DeleteUrl, clientId1.ToString())); Assert.AreEqual(await db.AzureApps.AsQueryable().CountAsync(), 2); Assert.AreEqual(await db.AppAuths.AsQueryable().CountAsync(), 1); }