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); }
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); }
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()); }
public void SimplePropertyClass_CanBeCreated() { SimplePropertyClass obj = mSession.Single <SimplePropertyClass>().Get(); Assert.NotNull(obj); }