public void TryGetConfigurationItem_FailsNoRazorConfigurationItems() { // Arrange var projectItems = Enumerable.Empty <IMSBuildItemEvaluated>(); // Act var result = DefaultRazorProjectHost.TryGetConfigurationItem("Razor-13.37", projectItems, out var configurationItem); // Assert Assert.False(result); Assert.Null(configurationItem); }
public void TryGetConfigurationItem_FailsNoMatchingRazorConfigurationItems() { // Arrange var projectItems = new IMSBuildItemEvaluated[] { new TestMSBuildItem("RazorConfiguration") { Include = "Razor-10.0", } }; // Act var result = DefaultRazorProjectHost.TryGetConfigurationItem("Razor-13.37", projectItems, out var configurationItem); // Assert Assert.False(result); Assert.Null(configurationItem); }
public void TryGetConfigurationItem_SucceedsForMatchingConfigurationItem() { // Arrange var expectedConfiguration = "Razor-13.37"; var expectedConfigurationItem = new TestMSBuildItem("RazorConfiguration") { Include = expectedConfiguration, }; var projectItems = new IMSBuildItemEvaluated[] { new TestMSBuildItem("RazorConfiguration") { Include = "Razor-10.0-DoesNotMatch", }, expectedConfigurationItem }; // Act var result = DefaultRazorProjectHost.TryGetConfigurationItem(expectedConfiguration, projectItems, out var configurationItem); // Assert Assert.True(result); Assert.Same(expectedConfigurationItem, configurationItem); }