Esempio n. 1
0
        public void RamAboveMinimumBelowRecommendedHasOneMandatoryCanInstall()
        {
            // Arrange
            IInstallationPrerequisiteProvider installationPrerequisiteProvider = new MockInstallationPrerequisiteProvider()
            {
                RamPrerequisiteStatus          = PrerequisiteStatus.BetweenMandatoryAndRecommended,
                FlashActiveXPrerequisiteStatus = PrerequisiteStatus.Exists
            };

            InstallationPrerequisiteCollection collection = new InstallationPrerequisiteCollection(installationPrerequisiteProvider);

            collection.Add(new RAMPrerequisite(new PictureBox()));
            collection.Add(new FlashActiveXPerequisite(new LinkLabel(), new PictureBox()));

            // Act
            collection.CheckAllPrerequisites();

            // Assert
            Assert.IsFalse(collection.PrerequisitesFullyMet);
            Assert.IsTrue(collection.CanContinueWithInstallation);
        }
Esempio n. 2
0
        public void DoesNotHaveOneMandatoryHasOneOptional()
        {
            // Arrange
            IInstallationPrerequisiteProvider installationPrerequisiteProvider = new MockInstallationPrerequisiteProvider()
            {
                QTPrerequisiteStatus           = PrerequisiteStatus.Exists,
                FlashActiveXPrerequisiteStatus = PrerequisiteStatus.DoesNotExist
            };

            InstallationPrerequisiteCollection collection = new InstallationPrerequisiteCollection(installationPrerequisiteProvider);

            collection.Add(new QTPrerequisite(new LinkLabel(), new PictureBox()));
            collection.Add(new FlashActiveXPerequisite(new LinkLabel(), new PictureBox()));

            // Act
            collection.CheckAllPrerequisites();

            // Assert
            Assert.IsFalse(collection.PrerequisitesFullyMet);
            Assert.IsFalse(collection.CanContinueWithInstallation);
        }
Esempio n. 3
0
        public void HasAllProvidedPrerequisites()
        {
            // Arrange
            IInstallationPrerequisiteProvider installationPrerequisiteProvider = new MockInstallationPrerequisiteProvider()
            {
                QTPrerequisiteStatus           = PrerequisiteStatus.Exists,
                FlashActiveXPrerequisiteStatus = PrerequisiteStatus.Exists
            };

            InstallationPrerequisiteCollection collection = new InstallationPrerequisiteCollection(installationPrerequisiteProvider);

            collection.Add(new QTPrerequisite(new LinkLabel(), new PictureBox()));
            collection.Add(new FlashActiveXPerequisite(new LinkLabel(), new PictureBox()));

            // Act
            collection.CheckAllPrerequisites();

            // Assert
            Assert.IsTrue(collection.PrerequisitesFullyMet);
            Assert.IsTrue(collection.CanContinueWithInstallation);
        }
Esempio n. 4
0
        public void DoesNotHaveDotNet35()
        {
            // Arrange
            IInstallationPrerequisiteProvider installationPrerequisiteProvider = new MockInstallationPrerequisiteProvider()
            {
                DotNet35PrerequisiteStatus = PrerequisiteStatus.DoesNotExist
            };

            InstallationPrerequisiteCollection collection = new InstallationPrerequisiteCollection(installationPrerequisiteProvider);

            DotNet35Prerequisite ramPrerequisite = new DotNet35Prerequisite(new LinkLabel(), new PictureBox());

            collection.Add(ramPrerequisite);

            // Act
            collection.CheckAllPrerequisites();

            // Assert
            Assert.IsFalse(collection.PrerequisitesFullyMet);
            Assert.IsFalse(collection.CanContinueWithInstallation);
            Assert.AreEqual(PrerequisiteStatus.DoesNotExist, ramPrerequisite.PrerequisiteStatus);
        }
Esempio n. 5
0
        public void RecommendedOrAboveRam()
        {
            // Arrange
            IInstallationPrerequisiteProvider installationPrerequisiteProvider = new MockInstallationPrerequisiteProvider()
            {
                RamPrerequisiteStatus = PrerequisiteStatus.Exists
            };

            InstallationPrerequisiteCollection collection = new InstallationPrerequisiteCollection(installationPrerequisiteProvider);

            RAMPrerequisite ramPrerequisite = new RAMPrerequisite(new PictureBox());

            collection.Add(ramPrerequisite);

            // Act
            collection.CheckAllPrerequisites();

            // Assert
            Assert.IsTrue(collection.PrerequisitesFullyMet);
            Assert.IsTrue(collection.CanContinueWithInstallation);
            Assert.AreEqual(PrerequisiteStatus.Exists, ramPrerequisite.PrerequisiteStatus);
        }
Esempio n. 6
0
        public void HasQuicktime()
        {
            // Arrange
            IInstallationPrerequisiteProvider installationPrerequisiteProvider = new MockInstallationPrerequisiteProvider()
            {
                QTPrerequisiteStatus = PrerequisiteStatus.Exists
            };

            InstallationPrerequisiteCollection collection = new InstallationPrerequisiteCollection(installationPrerequisiteProvider);

            QTPrerequisite ramPrerequisite = new QTPrerequisite(new LinkLabel(), new PictureBox());

            collection.Add(ramPrerequisite);

            // Act
            collection.CheckAllPrerequisites();

            // Assert
            Assert.IsTrue(collection.PrerequisitesFullyMet);
            Assert.IsTrue(collection.CanContinueWithInstallation);
            Assert.AreEqual(PrerequisiteStatus.Exists, ramPrerequisite.PrerequisiteStatus);
        }
Esempio n. 7
0
        public void InsufficientRam()
        {
            // Arrange
            IInstallationPrerequisiteProvider installationPrerequisiteProvider = new MockInstallationPrerequisiteProvider()
            {
                RamPrerequisiteStatus = PrerequisiteStatus.DoesNotExist
            };

            InstallationPrerequisiteCollection collection = new InstallationPrerequisiteCollection(installationPrerequisiteProvider);

            RAMPrerequisite ramPrerequisite = new RAMPrerequisite(new PictureBox());

            collection.Add(ramPrerequisite);

            // Act
            collection.CheckAllPrerequisites();

            // Assert
            Assert.IsFalse(collection.PrerequisitesFullyMet);
            Assert.IsFalse(collection.CanContinueWithInstallation);
            Assert.AreEqual(PrerequisiteStatus.DoesNotExist, ramPrerequisite.PrerequisiteStatus);
        }