コード例 #1
0
        public void PropertySupport_ArrangeGetterReturnValue_IsVerified()
        {
            var mockContext = new MockContext <IProp>();
            var propMock    = new PropMock(mockContext);

            mockContext.Arrange(x => x.ReadOnlyProperty).Returns(() => "result");

            var propertyValue = propMock.ReadOnlyProperty;

            Assert.AreEqual("result", propertyValue);
        }
コード例 #2
0
        public void PropertySupport_ArrangeGetterAndSetter_IsVerified()
        {
            var mockContext = new MockContext <IProp>();
            var propMock    = new PropMock(mockContext);

            mockContext.ArrangeProperty(x => x.TwoWayProperty);

            var propertyValue = propMock.TwoWayProperty;

            Assert.IsNull(propertyValue);

            propMock.TwoWayProperty = "customValue";

            propertyValue = propMock.TwoWayProperty;
            Assert.AreEqual("customValue", propertyValue);
        }
コード例 #3
0
ファイル: MockContextTests.cs プロジェクト: gazzyt/LightMock
        public void PropertySupport_ArrangeGetterAndSetter_IsVerified()
        {
            var mockContext = new MockContext<IProp>();
            var propMock = new PropMock(mockContext);
            mockContext.ArrangeProperty(x => x.TwoWayProperty);

            var propertyValue = propMock.TwoWayProperty;
            Assert.IsNull(propertyValue);

            propMock.TwoWayProperty = "customValue";

            propertyValue = propMock.TwoWayProperty;
            Assert.AreEqual("customValue", propertyValue);
        }
コード例 #4
0
ファイル: MockContextTests.cs プロジェクト: gazzyt/LightMock
        public void PropertySupport_ArrangeGetterReturnValue_IsVerified()
        {
            var mockContext = new MockContext<IProp>();
            var propMock = new PropMock(mockContext);
            mockContext.Arrange(x => x.ReadOnlyProperty).Returns(() => "result");

            var propertyValue = propMock.ReadOnlyProperty;
            Assert.AreEqual("result", propertyValue);
        }