public void ShouldReturnResultsFromScaffolderLocator() { // Arrange var mockScaffolderLocator = new Mock<IScaffolderLocator>(); var expectedResult = new List<ScaffolderInfo> { new ScaffolderInfo("name1", "packagename1", "location1", null, null), new ScaffolderInfo("name2", "packagename2", "location2", null, null), }; mockScaffolderLocator.Setup(x => x.GetScaffolders(_solutionManager.DefaultProject, "someScaffolder", true)).Returns(expectedResult); // Act var results = new GetScaffolderCmdlet(_solutionManager, null, mockScaffolderLocator.Object) { Name = "someScaffolder" }.GetResults<ScaffolderInfo>(); // Assert CollectionAssert.AreEqual(expectedResult, results.ToList()); }
public void ShouldBeAbleToSpecifyArbitraryProjectName() { // Arrange var vbProject = _solutionManager.GetProject("myVbProject"); var mockScaffolderLocator = new Mock<IScaffolderLocator>(); var expectedResult = new List<ScaffolderInfo> { new ScaffolderInfo("name1", "packagename1", "location1", null, null), new ScaffolderInfo("name2", "packagename2", "location2", null, null), }; mockScaffolderLocator.Setup(x => x.GetScaffolders(vbProject, "someScaffolder", true)).Returns(expectedResult); // Act var results = new GetScaffolderCmdlet(_solutionManager, null, mockScaffolderLocator.Object) { Name = "someScaffolder", Project = vbProject.Name }.GetResults<ScaffolderInfo>(); // Assert CollectionAssert.AreEqual(expectedResult, results.ToList()); }