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"));
        }
 public void Windows7NamedVersionOrGreater()
 {
     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.True(RequirementViewModel.OrGreater);
 }
        public void Windows8NamedVersionOrGreater()
        {
            RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindows8+");
            bool success = RequirementViewModel.Parse();

            Assert.True(success);
            Assert.Equal(RequirementViewModel.Product, "Windows");
            Assert.Equal(RequirementViewModel.NamedVersion, "Windows 8");
            Assert.Equal(RequirementViewModel.Type, null);
            Assert.Equal(RequirementViewModel.Architecture, null);
            Assert.Equal(RequirementViewModel.Version, new Version(6, 2, 0, 0));
            Assert.True(RequirementViewModel.OrGreater);
        }
        public void WindowsServerNumericVersion()
        {
            RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindowsServerVersion6.2");
            bool success = RequirementViewModel.Parse();

            Assert.True(success);
            Assert.Equal(RequirementViewModel.Product, "Windows");
            Assert.Equal(RequirementViewModel.NamedVersion, null);
            Assert.Equal(RequirementViewModel.Type, "Server");
            Assert.Equal(RequirementViewModel.Architecture, null);
            Assert.Equal(RequirementViewModel.Version, new Version(6, 2, 0, 0));
            Assert.False(RequirementViewModel.OrGreater);
        }
        public void WindowsServer64NumericVersionWithServicePackOrGreater()
        {
            RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindowsServerx64Version6.1sp3.1+");
            bool success = RequirementViewModel.Parse();

            Assert.True(success);
            Assert.Equal(RequirementViewModel.Product, "Windows");
            Assert.Equal(RequirementViewModel.NamedVersion, null);
            Assert.Equal(RequirementViewModel.Type, "Server");
            Assert.Equal(RequirementViewModel.Architecture, "x64");
            Assert.Equal(RequirementViewModel.Version, new Version(6, 1, 0, 0));
            Assert.Equal(RequirementViewModel.ServicePack, new Version(3, 1, 0, 0));
            Assert.True(RequirementViewModel.OrGreater);
        }
        public void WindowsClient32NumericVersionWithServicePackOrGreater()
        {
            RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindowsClientx86Version6.2sp3+");
            bool success = RequirementViewModel.Parse();

            Assert.True(success);
            Assert.Equal(RequirementViewModel.Product, "Windows");
            Assert.Equal(RequirementViewModel.NamedVersion, null);
            Assert.Equal(RequirementViewModel.Type, "Client");
            Assert.Equal(RequirementViewModel.Architecture, "x86");
            Assert.Equal(RequirementViewModel.Version, new Version(6, 2, 0, 0));
            Assert.Equal(RequirementViewModel.ServicePack, new Version(3, 0, 0, 0));
            Assert.True(RequirementViewModel.OrGreater);
        }
        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"));
 }
Esempio n. 10
0
 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"));
 }
Esempio n. 11
0
 public void WindowsNumericVersionWithArchitecture()
 {
     RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindowsx64Version6.2");
     bool success = RequirementViewModel.Parse();
     Assert.True(success);
     Assert.Equal(RequirementViewModel.Product, "Windows");
     Assert.Equal(RequirementViewModel.NamedVersion, null);
     Assert.Equal(RequirementViewModel.Type, null);
     Assert.Equal(RequirementViewModel.Architecture, "x64");
     Assert.Equal(RequirementViewModel.Version, new Version(6, 2, 0, 0));
     Assert.Equal(RequirementViewModel.ServicePack, null);
     Assert.False(RequirementViewModel.OrGreater);
 }
Esempio n. 12
0
 public void WindowsServer64NumericVersionWithServicePackOrGreater()
 {
     RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindowsServerx64Version6.1sp3.1+");
     bool success = RequirementViewModel.Parse();
     Assert.True(success);
     Assert.Equal(RequirementViewModel.Product, "Windows");
     Assert.Equal(RequirementViewModel.NamedVersion, null);
     Assert.Equal(RequirementViewModel.Type, "Server");
     Assert.Equal(RequirementViewModel.Architecture, "x64");
     Assert.Equal(RequirementViewModel.Version, new Version(6, 1, 0, 0));
     Assert.Equal(RequirementViewModel.ServicePack, new Version(3, 1, 0, 0));
     Assert.True(RequirementViewModel.OrGreater);
 }
Esempio n. 13
0
 public void WindowsClient32NumericVersionWithServicePackOrGreater()
 {
     RequirementViewModel RequirementViewModel = new RequirementViewModel("RequiresWindowsClientx86Version6.2sp3+");
     bool success = RequirementViewModel.Parse();
     Assert.True(success);
     Assert.Equal(RequirementViewModel.Product, "Windows");
     Assert.Equal(RequirementViewModel.NamedVersion, null);
     Assert.Equal(RequirementViewModel.Type, "Client");
     Assert.Equal(RequirementViewModel.Architecture, "x86");
     Assert.Equal(RequirementViewModel.Version, new Version(6, 2, 0, 0));
     Assert.Equal(RequirementViewModel.ServicePack, new Version(3, 0, 0, 0));
     Assert.True(RequirementViewModel.OrGreater);
 }