Пример #1
0
        public void IsBDDObjectsNull_Should_ReturnFalse_Given_ANonEmptyBDDObjectsArray()
        {
            RunnerEditorBusinessLogicParametersRebuild runnerEditorBusinessLogicParametersRebuild = new RunnerEditorBusinessLogicParametersRebuild();
            RunnerEditorBusinessLogicData runnerBusinessLogicData = new RunnerEditorBusinessLogicData();

            runnerBusinessLogicData.BDDObjects = new object[1];
            bool result = runnerEditorBusinessLogicParametersRebuild.IsBDDObjectsNull(runnerBusinessLogicData);

            Assert.IsFalse(result, "The method IsBDDObjectsNull doesn't return the right state of the BDDObjects");
        }
Пример #2
0
        public void IsParametersRebuildNeeded_Should_ReturnFalse_Given_TheBDDObjectsIsNullAndBDDObjectsDidNotChangedAndEditorApplicationIsCompilingIsFalseAndCompilingJustFinishedIsFalseAndItIsADynamicScenario()
        {
            RunnerEditorBusinessLogicParametersRebuild runnerEditorBusinessLogicParametersRebuild = new RunnerEditorBusinessLogicParametersRebuild();
            bool isBDDObjectsNull                         = false;
            bool bddObjectsHaveChanged                    = false;
            bool isEditorApplicationCompiling             = false;
            bool isEditorApplicationCompilingJustFinished = false;
            bool rebuild           = false;
            bool isDynamicScenario = true;
            bool result            = runnerEditorBusinessLogicParametersRebuild.IsParametersRebuildNeeded(isBDDObjectsNull, bddObjectsHaveChanged, isEditorApplicationCompiling, isEditorApplicationCompilingJustFinished, rebuild, isDynamicScenario);

            Assert.IsFalse(result, "The method IsParametersRebuildNeeded returns the wrong rebuild state");
        }
Пример #3
0
        public void IsEditorApplicationCompilingJustFinished_Should_ReturnTrueAndSetTheValueOfIsCompilingPropertyToFalse_Given_TheStateOfIsCompilingPropertyIsTrueAndTheStateOfTheEditorApplicationIsCompilingPropertyIsFalse()
        {
            RunnerEditorBusinessLogicParametersRebuild runnerEditorBusinessLogicParametersRebuild = new RunnerEditorBusinessLogicParametersRebuild();
            RunnerEditorBusinessLogicData runnerBusinessLogicData = new RunnerEditorBusinessLogicData();

            IUnityInterfaceWrapper unityInterfaceWrapper = Substitute.For <IUnityInterfaceWrapper>();

            unityInterfaceWrapper.EditorApplicationIsCompiling().Returns(false);
            runnerBusinessLogicData.IsCompiling = true;
            bool result = runnerEditorBusinessLogicParametersRebuild.IsEditorApplicationCompilingJustFinished(unityInterfaceWrapper, runnerBusinessLogicData);

            Assert.IsTrue(result, "The method IsEditorApplicationCompilingJustFinished doesn't return the right state of editor compilation just finished");
            Assert.IsFalse(runnerBusinessLogicData.IsCompiling, "The method IsEditorApplicationCompilingJustFinished doesn't return the right last state of editor compilation");
        }
Пример #4
0
        public void BddObjectsHaveChanged_Should_ReturnFalse_GivenTheBDDObjectsArrayIsNullAndTheCurrentComponentsArrayIsEmpty()
        {
            RunnerEditorBusinessLogicParametersRebuild runnerEditorBusinessLogicParametersRebuild = new RunnerEditorBusinessLogicParametersRebuild();
            RunnerEditorBusinessLogicData runnerBusinessLogicData = new RunnerEditorBusinessLogicData();

            runnerBusinessLogicData.BDDObjects = null;
            Component[]      currentComponents   = new Component[0];
            ComponentsFilter bddComponentsFilter = Substitute.For <ComponentsFilter>();

            Component[] bddComponentsFilterResult = new Component[0];
            bddComponentsFilter.Filter(currentComponents).Returns <Component[]>(bddComponentsFilterResult);

            bool result = runnerEditorBusinessLogicParametersRebuild.BddObjectsHaveChanged(currentComponents, runnerBusinessLogicData, bddComponentsFilter);

            Assert.IsFalse(result, "The method BddObjectsHaveChanged doesn't return the right state");
        }
Пример #5
0
        public void BddObjectsHaveChanged_Should_ReturnTrue_GivenTheBDDObjectsArrayIsNullAndTheCurrentComponentsArrayIsNotEmpty()
        {
            RunnerEditorBusinessLogicParametersRebuild runnerEditorBusinessLogicParametersRebuild = new RunnerEditorBusinessLogicParametersRebuild();
            RunnerEditorBusinessLogicData runnerBusinessLogicData = new RunnerEditorBusinessLogicData();

            runnerBusinessLogicData.BDDObjects = null;
            Component[] currentComponents = new Component[1] {
                UnitTestUtility.CreateComponent <RunnerEditorBusinessLogicParametersRebuildUTDynamicBDDForTest>()
            };
            ComponentsFilter bddComponentsFilter = Substitute.For <ComponentsFilter>();

            Component[] bddComponentsFilterResult = new Component[1] {
                currentComponents[0]
            };
            bddComponentsFilter.Filter(currentComponents).Returns <Component[]>(bddComponentsFilterResult);

            bool result = runnerEditorBusinessLogicParametersRebuild.BddObjectsHaveChanged(currentComponents, runnerBusinessLogicData, bddComponentsFilter);

            Assert.IsTrue(result, "The method BddObjectsHaveChanged doesn't return the right state");
        }