public void Windows7NamedVersion() { RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindows7"); bool success = RequirementViewModel.Parse(); Assert.True(success); Assert.Equal(RequirementViewModel.Product, "Windows"); Assert.Equal(RequirementViewModel.NamedVersion, "Windows 7"); Assert.Equal(RequirementViewModel.Type, null); Assert.Equal(RequirementViewModel.Architecture, null); Assert.Equal(RequirementViewModel.Version, new Version(6, 1, 0, 0)); Assert.False(RequirementViewModel.OrGreater); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(0, 0, 0, 0), "Client", "x86")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(0, 0, 0, 0), "Client", "x86")); }
public void WindowsNumericVersionSPTypeArchOrGreaterRequirementIsMet() { RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindowsClientx86Version6.1sp2+"); bool success = RequirementViewModel.Parse(); Assert.True(success); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(2, 0, 0, 0), "Client", "x86")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(3, 1, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(3, 1, 0, 0), "Client", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(2, 1, 0, 0), "Client", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(2, 0, 0, 0), "Server", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(3, 1, 0, 0), "Server", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(3, 1, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(2, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(1, 1, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(0, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(1, 1, 0, 0), "Client", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(0, 0, 0, 0), "Client", "x64")); Assert.True(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(0, 0, 0, 0), "Client", "x86")); Assert.True(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(1, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(0, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(1, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(0, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(1, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(0, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(1, 0, 0, 0), "Server", "x64")); }
public void WindowsNamedVersionSPRequirementIsMet() { RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindows7sp2"); bool success = RequirementViewModel.Parse(); Assert.True(success); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(2, 0, 0, 0), "Client", "x86")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(3, 1, 0, 0), "Client", "x86")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(3, 1, 0, 0), "Client", "x64")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(2, 1, 0, 0), "Client", "x64")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(2, 0, 0, 0), "Server", "x86")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(3, 1, 0, 0), "Server", "x86")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(3, 1, 0, 0), "Server", "x64")); Assert.True(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(2, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(1, 1, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(0, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 0, 0), new Version(1, 1, 0, 0), "Client", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 1, 1, 1), new Version(0, 0, 0, 0), "Client", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(0, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(1, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(0, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(1, 0, 0, 0), "Client", "x86")); Assert.False(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(0, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 2, 0, 0), new Version(1, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(0, 0, 0, 0), "Server", "x64")); Assert.False(RequirementViewModel.IsMet(new Version(6, 0, 0, 0), new Version(1, 0, 0, 0), "Server", "x64")); }