public virtual void TestRollback() { // Verifies that if rollback is called, DTW is closed. Directory dir = NewDirectory(); var dtw = new DirectoryTaxonomyWriter(dir); dtw.AddCategory(new FacetLabel("a")); dtw.Rollback(); try { dtw.AddCategory(new FacetLabel("a")); Fail("should not have succeeded to add a category following rollback."); } catch (AlreadyClosedException) { // expected } dir.Dispose(); }
public virtual void TestRollback() { // Verifies that if rollback is called, DTW is closed. Directory dir = NewDirectory(); var dtw = new DirectoryTaxonomyWriter(dir); dtw.AddCategory(new FacetLabel("a")); dtw.Rollback(); try { dtw.AddCategory(new FacetLabel("a")); Fail("should not have succeeded to add a category following rollback."); } catch (AlreadyClosedException) { // expected } dir.Dispose(); }