public void UpdatePreviousEnvironmentWithSubExecutionResultUsingOutputMappings_GivenEnvHasErrors_ShouldAddErrorsToResultTo()
        {
            //---------------Set up test pack-------------------
            var manager = new EnvironmentOutputMappingManager();
            //---------------Assert Precondition----------------
            var dsfObject = new Mock <IDSFDataObject>();
            var env       = new Mock <IExecutionEnvironment>();

            env.Setup(environment => environment.HasErrors()).Returns(true);
            env.SetupGet(environment => environment.AllErrors).Returns(new HashSet <string>()
            {
                "Error", "Error1"
            });
            env.SetupGet(environment => environment.Errors).Returns(new HashSet <string>()
            {
                "Error", "Error1"
            });
            dsfObject.Setup(o => o.PopEnvironment());
            dsfObject.Setup(o => o.Environment).Returns(env.Object);
            dsfObject.Setup(o => o.Environment).Returns(env.Object);
            //---------------Execute Test ----------------------
            var errors = new ErrorResultTO();
            var executionEnvironment = manager.UpdatePreviousEnvironmentWithSubExecutionResultUsingOutputMappings(dsfObject.Object, "", 0, false, errors);

            //---------------Test Result -----------------------
            dsfObject.Verify(o => o.PopEnvironment(), Times.Once);
            env.VerifyGet(o => o.AllErrors);
            env.VerifyGet(o => o.Errors);
            Assert.IsNotNull(executionEnvironment);
        }
        public void UpdatePreviousEnvironmentWithSubExecutionResultUsingOutputMappings_GivenValidArgs_ShouldNotThrowException()
        {
            //---------------Set up test pack-------------------
            var manager = new EnvironmentOutputMappingManager();
            //---------------Assert Precondition----------------
            var dsfObject = new Mock <IDSFDataObject>();
            var env       = new Mock <IExecutionEnvironment>();

            dsfObject.Setup(o => o.PopEnvironment());
            dsfObject.Setup(o => o.Environment).Returns(env.Object);

            //---------------Execute Test ----------------------
            var errors = new ErrorResultTO();
            var executionEnvironment = manager.UpdatePreviousEnvironmentWithSubExecutionResultUsingOutputMappings(dsfObject.Object, "", 0, true, errors);

            //---------------Test Result -----------------------
            dsfObject.Verify(o => o.PopEnvironment(), Times.Once);
            Assert.IsNotNull(executionEnvironment);
        }