Skip to content

Commit a0bc6e9

Browse files
committed
Ensure SC displays an error for null projects.
1 parent 50210ea commit a0bc6e9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

RubberduckTests/SourceControl/SourceControlViewModelTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,22 @@ public void OnBrowseDefaultRepoLocation_WhenUserCancels_LocalDirectoryDoesNotCha
975975
Assert.AreEqual(originalPath, _vm.LocalDirectory);
976976
}
977977

978+
[TestMethod]
979+
public void NullProject_DisplaysError()
980+
{
981+
//arrange
982+
SetupValidVbProject();
983+
SetupVM();
984+
_vbe.Setup(v => v.ActiveVBProject).Returns((VBProject)null);
985+
_vbe.Setup(v => v.VBProjects).Returns(new Mock<VBProjects>().Object);
986+
987+
//act
988+
_vm.RefreshCommand.Execute(null);
989+
990+
//assert
991+
Assert.IsTrue(_vm.DisplayErrorMessageGrid, "Null ActiveProject did not raise error.");
992+
}
993+
978994
private const string DummyRepoId = "SourceControlTest";
979995

980996
private SourceControlSettings GetDummyConfig()

0 commit comments

Comments
 (0)