コード例 #1
0
        public void GivenDoubleProperty_WhenHandle_ThenReturnsCorrectValue()
        {
            var page = new ValueTypePropertyHandlerPage
            {
                Double = 10.50
            };

            var result = (double)this._sut.Handle(
                page.Double,
                page.GetType().GetProperty(nameof(ValueTypePropertyHandlerPage.Double)),
                page);

            result.ShouldBe(10.50);
        }
コード例 #2
0
        public void GivenBoolProperty_WhenHandle_ThenReturnsCorrectValue()
        {
            var page = new ValueTypePropertyHandlerPage
            {
                Bool = true
            };

            var result = (bool)this._sut.Handle(
                page.Bool,
                page.GetType().GetProperty(nameof(ValueTypePropertyHandlerPage.Bool)),
                page);

            result.ShouldBeTrue();
        }
コード例 #3
0
        public void GivenIntProperty_WhenHandle_ThenReturnsCorrectValue()
        {
            var page = new ValueTypePropertyHandlerPage
            {
                Integer = 1000
            };

            var result = (int)this._sut.Handle(
                page.Integer,
                page.GetType().GetProperty(nameof(ValueTypePropertyHandlerPage.Integer)),
                page);

            result.ShouldBe(1000);
        }
コード例 #4
0
        public void GivenDateTimeProperty_WhenHandle_ThenReturnsCorrectValue()
        {
            var expected = new DateTime(2000, 01, 01, 12, 00, 30);
            var page     = new ValueTypePropertyHandlerPage
            {
                DateTime = expected
            };

            var result = (DateTime)this._sut.Handle(
                page.DateTime,
                page.GetType().GetProperty(nameof(ValueTypePropertyHandlerPage.DateTime)),
                page);

            result.ShouldBe(expected);
        }