public IEnumerable <Guid> GetAggregateProjectKinds(IVsHierarchy hierarchy) { LegacyProjectMock dteProject = hierarchy as LegacyProjectMock; if (dteProject == null) { FluentAssertions.Execution.Execute.Assertion.FailWith($"Only expecting {nameof(LegacyProjectMock)} type"); } return(dteProject.GetAggregateProjectTypeGuids()); }
public void ProjectSystemHelper_GetAggregateProjectKinds_NoGuids_ReturnsEmpty() { // Arrange var project = new LegacyProjectMock("my.project"); project.SetAggregateProjectTypeString(string.Empty); // Act Guid[] actualGuids = this.testSubject.GetAggregateProjectKinds(project).ToArray(); // Assert actualGuids.Should().BeEmpty("Expected no GUIDs returned"); }
public void ProjectSystemHelper_GetAggregateProjectKinds_HasGoodAndBadGuids_ReturnsSuccessfullyParsedGuidsOnly() { // Arrange string guidString = ";;;F602148F607646F88F7772CC9C49BC3F;;__BAD__;;__BADGUID__;0BA323B301614B1C80D74607B7EB7F5A;;;__FOO__;;;"; Guid[] expectedGuids = new[] { new Guid("F602148F607646F88F7772CC9C49BC3F"), new Guid("0BA323B301614B1C80D74607B7EB7F5A"), }; var project = new LegacyProjectMock("my.project"); project.SetAggregateProjectTypeString(guidString); // Act Guid[] actualGuids = this.testSubject.GetAggregateProjectKinds(project).ToArray(); // Assert CollectionAssert.AreEquivalent(expectedGuids, actualGuids, "Unexpected project kind GUIDs returned"); }