public void Skips_BothMacOSXAndLinux() { // Act var osSkipAttributeLinux = new OSSkipConditionAttribute(OperatingSystems.Linux | OperatingSystems.MacOSX, OperatingSystems.Linux, string.Empty); var osSkipAttributeMacOSX = new OSSkipConditionAttribute(OperatingSystems.Linux | OperatingSystems.MacOSX, OperatingSystems.MacOSX, string.Empty); // Assert Assert.False(osSkipAttributeLinux.IsMet); Assert.False(osSkipAttributeMacOSX.IsMet); }
public void Skips_BothWindowsAndLinux() { // Act var osSkipAttribute = new OSSkipConditionAttribute(OperatingSystems.Linux | OperatingSystems.Windows, OperatingSystems.Windows, string.Empty); var osSkipAttributeLinux = new OSSkipConditionAttribute(OperatingSystems.Linux | OperatingSystems.Windows, OperatingSystems.Linux, string.Empty); // Assert Assert.False(osSkipAttribute.IsMet); Assert.False(osSkipAttributeLinux.IsMet); }
public void Skips_BothMacOSXAndWindows() { // Act var osSkipAttribute = new OSSkipConditionAttribute(OperatingSystems.Windows | OperatingSystems.MacOSX, OperatingSystems.Windows, string.Empty); var osSkipAttributeMacOSX = new OSSkipConditionAttribute(OperatingSystems.Windows | OperatingSystems.MacOSX, OperatingSystems.MacOSX, string.Empty); // Assert Assert.False(osSkipAttribute.IsMet); Assert.False(osSkipAttributeMacOSX.IsMet); }
public void DoesNotSkip_WhenOperatingSystemDoesNotMatch() { // Act var osSkipAttribute = new OSSkipConditionAttribute( OperatingSystems.Linux, OperatingSystems.Windows, "2.5"); // Assert Assert.True(osSkipAttribute.IsMet); }
public void Skips_WhenOnlyOperatingSystemIsSupplied() { // Act var osSkipAttribute = new OSSkipConditionAttribute( OperatingSystems.Windows, OperatingSystems.Windows, "2.5"); // Assert Assert.False(osSkipAttribute.IsMet); }
public void Skips_WhenVersionsMatchesOutOfMultiple() { // Arrange var env = new MockRuntimeEnvironment("Windows", "2.5", Platform.Windows); // Act var osSkipAttribute = new OSSkipConditionAttribute(OperatingSystems.Windows, env, "10.0", "3.4", "2.5"); // Assert Assert.False(osSkipAttribute.IsMet); }
public void Skips_WhenVersionsMatches(string currentOSVersion, string skipVersion) { // Arrange var env = new MockRuntimeEnvironment("Windows", currentOSVersion, Platform.Windows); // Act var osSkipAttribute = new OSSkipConditionAttribute(OperatingSystems.Windows, env, skipVersion); // Assert Assert.False(osSkipAttribute.IsMet); }
public void DoesNotSkip_WhenOnlyVersionsMatch() { // Arrange var env = new MockRuntimeEnvironment("Windows", "2.5", Platform.Windows); // Act var osSkipAttribute = new OSSkipConditionAttribute(OperatingSystems.Linux, env, "2.5"); // Assert Assert.True(osSkipAttribute.IsMet); }
public void Skips_WhenOnlyOperatingSystemIsSupplied() { // Arrange var env = new MockRuntimeEnvironment("Windows", "2.5", Platform.Windows); // Act var osSkipAttribute = new OSSkipConditionAttribute(OperatingSystems.Windows, env); // Assert Assert.False(osSkipAttribute.IsMet); }
public void Skips_WhenVersionsMatchesOutOfMultiple() { // Act var osSkipAttribute = new OSSkipConditionAttribute( OperatingSystems.Windows, OperatingSystems.Windows, "2.5", "10.0", "3.4", "2.5"); // Assert Assert.False(osSkipAttribute.IsMet); }
public void Skips_WhenVersionsMatches(string currentOSVersion, string skipVersion) { // Act var osSkipAttribute = new OSSkipConditionAttribute( OperatingSystems.Windows, OperatingSystems.Windows, currentOSVersion, skipVersion); // Assert Assert.False(osSkipAttribute.IsMet); }
public void DoesNotSkip_WhenVersionsDoNotMatch() { // Act var osSkipAttribute = new OSSkipConditionAttribute( OperatingSystems.Windows, Platform.Windows, "2.5", "10.0"); // Assert Assert.True(osSkipAttribute.IsMet); }
public void Throws_OnUnrecognizedOperatingSystem() { // Act var osSkipAttribute = new OSSkipConditionAttribute( OperatingSystems.Windows, Platform.Unknown, "2.5"); // Assert var exception = Assert.Throws <InvalidOperationException>(() => osSkipAttribute.IsMet); Assert.Equal($"Unrecognized operating system '{Platform.Unknown}'.", exception.Message); }
public void Throws_OnUnrecognizedOperatingSystem() { // Arrange var osName = "Blah"; var env = new MockRuntimeEnvironment(osName, "2.5", Platform.Unknown); // Act var osSkipAttribute = new OSSkipConditionAttribute(OperatingSystems.Windows, env); // Assert var exception = Assert.Throws <InvalidOperationException>(() => osSkipAttribute.IsMet); Assert.Equal($"Unrecognized operating system '{Platform.Unknown}'.", exception.Message); }