Пример #1
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");
        }
Пример #2
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");
        }