Ejemplo n.º 1
0
        public void GetViewData_Always_ReturnWrappedData()
        {
            // Setup
            var calculationGroup = new CalculationGroup();
            var failureMechanism = new ClosingStructuresFailureMechanism();
            var context          = new ClosingStructuresScenariosContext(calculationGroup, failureMechanism);

            // Call
            object viewData = info.GetViewData(context);

            // Assert
            Assert.AreSame(calculationGroup, viewData);
        }
Ejemplo n.º 2
0
        public void CreateInstance_WithContext_ReturnsClosingStructuresScenariosView()
        {
            // Setup
            var group   = new CalculationGroup();
            var context = new ClosingStructuresScenariosContext(group, new ClosingStructuresFailureMechanism());

            // Call
            using (IView view = info.CreateInstance(context))
            {
                // Assert
                Assert.IsInstanceOf <ClosingStructuresScenariosView>(view);
                Assert.AreSame(group, view.Data);
            }
        }
Ejemplo n.º 3
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var calculationGroup = new CalculationGroup();
            var failureMechanism = new ClosingStructuresFailureMechanism();

            // Call
            var context = new ClosingStructuresScenariosContext(calculationGroup, failureMechanism);

            // Assert
            Assert.IsInstanceOf <WrappedObjectContextBase <CalculationGroup> >(context);
            Assert.AreSame(calculationGroup, context.WrappedData);
            Assert.AreSame(failureMechanism, context.ParentFailureMechanism);
        }