コード例 #1
0
        public void Enact_SetsFieldWithSourceValue()
        {
            mSourceMock.Setup(x => x.Next(It.IsAny<IGenerationContext>())).Returns("Test");

            SimplePropertyClass target = new SimplePropertyClass();
            mAction.Enact(mContext, target);

            Assert.AreEqual("Test", target.SomeProperty);
        }
コード例 #2
0
        public void Enact_SetsFieldWithValue()
        {
            ObjectPropertySetFromValueAction action = new ObjectPropertySetFromValueAction((EngineTypePropertyMember)
                ReflectionHelper.GetMember<SimplePropertyClass>(x => x.SomeProperty), "Test");

            SimplePropertyClass target = new SimplePropertyClass();
            action.Enact(null, target);

            Assert.AreEqual("Test", target.SomeProperty);
        }
コード例 #3
0
        public void Enact_Provides_Source_With_Wrapped_Up_Session()
        {
            SimplePropertyClass target = new SimplePropertyClass();
            mAction.Enact(mContext, target);

            mSourceMock.Verify(x => x.Next(It.Is<IGenerationContext>(y =>
                y.Node is TypePropertyGenerationContextNode &&
                y.Node.Parent == mParentNode)),
                               Times.Once());
        }