public void ShouldReturnNothingForUnknownProjectTypes() { // Arrange var solutionManager = new MockSolutionManagerBuilder( new MockProject("myProj") { Kind = "someUnknownProjectKind" } ).Build(); // Act var result = new GetProjectLanguageCmdlet(solutionManager).GetResults <string>(); // Assert Assert.AreEqual(0, result.Count()); }
public void ShouldBeAbleToSpecifyArbitraryProjectName() { // Arrange var solutionManager = new MockSolutionManagerBuilder( new MockProject("firstProj") { Kind = VsConstants.CsharpProjectTypeGuid }, new MockProject("secondProj") { Kind = VsConstants.VbProjectTypeGuid } ).Build(); // Act var result = new GetProjectLanguageCmdlet(solutionManager) { Project = "secondProj" }.GetResults <string>(); // Assert Assert.AreEqual("vb", result.Single()); }
public void ShouldReturnLanguageForKnownProjectTypes() { var testCases = new Dictionary <string, string> { { VsConstants.CsharpProjectTypeGuid, "cs" }, { VsConstants.VbProjectTypeGuid, "vb" }, }; foreach (var testCase in testCases) { // Arrange var solutionManager = new MockSolutionManagerBuilder( new MockProject("myProj") { Kind = testCase.Key } ).Build(); // Act var result = new GetProjectLanguageCmdlet(solutionManager).GetResults <string>(); // Assert Assert.AreEqual(testCase.Value, result.Single()); } }