Exemple #1
0
        public void TestValidateLeafInstallerWithCompositeInstallerWithoutCircularRefDeep()
        {
            var installer1 = new TestCompositeInstaller();
            var installer2 = new TestCompositeInstaller();
            var installer3 = new TestCompositeInstaller();

            installer1._leafInstallers = new List <TestInstaller>
            {
                _dummyInstaller1,
                installer2,
                _dummyInstaller2,
            };
            installer2._leafInstallers = new List <TestInstaller>
            {
                installer3,
            };
            installer3._leafInstallers = new List <TestInstaller>
            {
                _dummyInstaller3,
            };

            bool actual = installer1.ValidateLeafInstaller(_parentInstallers);

            Assert.True(actual);
        }
Exemple #2
0
        public void TestValidateLeafInstallerWithCompositeInstallerAndAnotherCircularRef()
        {
            var installer1 = new TestCompositeInstaller();
            var installer2 = new TestCompositeInstaller();
            var installer3 = new TestCompositeInstaller();

            installer1._leafInstallers = new List <TestInstaller>
            {
                _dummyInstaller1,
                installer2,
                _dummyInstaller2,
            };
            installer2._leafInstallers = new List <TestInstaller>
            {
                installer3,
            };
            installer3._leafInstallers = new List <TestInstaller>
            {
                installer2,  // a circular reference
                _dummyInstaller3,
            };

            bool actual = installer1.ValidateLeafInstaller(_parentInstallers);

            Assert.False(actual);
        }
Exemple #3
0
        public void TestValidateLeafInstallerWithCompositeInstallerWithoutCircularRef()
        {
            var installer = new TestCompositeInstaller
            {
                _leafInstallers = new List <TestInstaller>(),
            };

            bool actual = installer.ValidateLeafInstaller(_parentInstallers);

            Assert.True(actual);
        }
Exemple #4
0
        public void TestValidateLeafInstallerWithCompositeInstallerAndSelfCircularRef()
        {
            var installer = new TestCompositeInstaller();

            installer._leafInstallers = new List <TestInstaller>
            {
                installer,
            };

            bool actual = installer.ValidateLeafInstaller(_parentInstallers);

            Assert.False(actual);
        }