public async Task CanSave_NewFile() { using (var manager = new PluginManager()) { await manager.LoadCore(new TestCoreMod()); var testFile = new TextFile(); testFile.CreateFile("Test"); var testFileViewModel = new FileViewModel(testFile, manager); Assert.AreEqual(false, testFileViewModel.CanSave(manager)); } }
public async Task CanSave_OpenedFile() { using (var manager = new PluginManager()) { await manager.LoadCore(new TestCoreMod()); manager.CurrentFileSystem.WriteAllText("/test.txt", "testing"); var testFile = new TextFile(); await testFile.OpenFile("/test.txt", manager.CurrentFileSystem); var testFileViewModel = new FileViewModel(testFile, manager); Assert.AreEqual(true, testFileViewModel.CanSave(manager)); } }