public void PropertyGroupDescription_GroupNameFromItem_ByObject_Null()
        {
            var groupByStringProperty = new PropertyGroupDescription()
            {
                PropertyName = "ObjectProperty", MemberAccess = new DelegateMemberAccess <ValuesItem>((o) => o.ObjectProperty)
            };
            var item = new ValuesItem()
            {
                ObjectProperty = null
            };
            var groupName = groupByStringProperty.GroupNameFromItem(item, 0);

            Assert.AreEqual(null, groupName);
        }
        public void PropertyGroupDescription_GroupNameFromItem_ByDouble()
        {
            var groupByStringProperty = new PropertyGroupDescription()
            {
                PropertyName = "DoubleProperty", MemberAccess = new DelegateMemberAccess <ValuesItem>((o) => o.DoubleProperty)
            };
            var item = new ValuesItem()
            {
                DoubleProperty = 101.5d
            };
            var groupName = groupByStringProperty.GroupNameFromItem(item, 0);

            Assert.AreEqual(101.5d, groupName);
        }
        public void PropertyGroupDescription_GroupNameFromItem_ByBoolean()
        {
            var groupByStringProperty = new PropertyGroupDescription()
            {
                PropertyName = "BooleanProperty", MemberAccess = new DelegateMemberAccess <ValuesItem>((o) => o.BooleanProperty)
            };
            var item = new ValuesItem()
            {
                BooleanProperty = true
            };
            var groupName = groupByStringProperty.GroupNameFromItem(item, 0);

            Assert.AreEqual(true, groupName);
        }
        public void PropertyGroupDescription_GroupNameFromItem_ByString()
        {
            var groupByStringProperty = new PropertyGroupDescription()
            {
                PropertyName = "StringProperty", MemberAccess = new DelegateMemberAccess <ValuesItem>((o) => o.StringProperty)
            };
            var item = new ValuesItem()
            {
                StringProperty = "Hello World!"
            };
            var groupName = groupByStringProperty.GroupNameFromItem(item, 0);

            Assert.AreEqual("Hello World!", groupName);
        }
        public void PropertyGroupDescription_GroupNameFromItem_ShouldNotHandleOrRethrowExceptions()
        {
            var groupByErrorProperty = new PropertyGroupDescription()
            {
                PropertyName = "ErrorPrperty", MemberAccess = new DelegateMemberAccess <ValuesItem>((o) => o.ErrorProperty)
            };
            var item = new ValuesItem();

            try
            {
                var groupName = groupByErrorProperty.GroupNameFromItem(item, 0);
                Assert.Fail("Exception handeld.");
            }
            catch (Exception e)
            {
                Assert.IsInstanceOfType(e, typeof(ErrorPropertyException), "Expected exception type {0}, thrown {1}", typeof(ErrorPropertyException), e.GetType());
            }
        }