public void TestTruncateTableWithNoName() { Assert.Throws <ArgumentNullException>(() => { var expression = new TruncateTable(string.Empty); }); }
public async Task truncate_by_document() { var targets = Target.GenerateRandomData(100).ToList(); await theStore.BulkInsertAsync(targets); var op = new TruncateTable(typeof(Target)); theSession.QueueOperation(op); await theSession.SaveChangesAsync(); var count = await theSession.Query <Target>().CountAsync(); count.ShouldBe(0); }
public async Task truncate_by_table_name() { var targets = Target.GenerateRandomData(100).ToList(); await theStore.BulkInsertAsync(targets); var tableName = theStore.Options.Storage.MappingFor(typeof(Target)).TableName; var op = new TruncateTable(tableName); theSession.QueueOperation(op); await theSession.SaveChangesAsync(); var count = await theSession.Query <Target>().CountAsync(); count.ShouldBe(0); }
public void TestTruncateTable() { var expression = new TruncateTable("TestTable"); Assert.Equal("TRUNCATE TABLE TestTable", expression.ToString()); }