Пример #1
0
        public void HorizontalListShouldReturnLinearItemsLayout()
        {
            var converter = new ItemsLayoutTypeConverter();
            var result    = converter.ConvertFromInvariantString("HorizontalList");

            Assert.AreSame(LinearItemsLayout.Horizontal, result);
        }
Пример #2
0
        public void VerticalGridWithSpan1234ShouldReturnGridItemsLayout()
        {
            var converter = new ItemsLayoutTypeConverter();
            var result    = converter.ConvertFromInvariantString("VerticalGrid, \t 1234");

            Assert.IsInstanceOf <GridItemsLayout>(result);
            var gridItemsLayout = (GridItemsLayout)result;

            Assert.AreEqual(ItemsLayoutOrientation.Vertical, gridItemsLayout.Orientation);
            Assert.AreEqual(1234, gridItemsLayout.Span);
        }
Пример #3
0
        public void HorizontalGridWithSpan987654ShouldReturnGridItemsLayout()
        {
            var converter = new ItemsLayoutTypeConverter();
            var result    = converter.ConvertFromInvariantString("HorizontalGrid,98654");

            Assert.IsInstanceOf <GridItemsLayout>(result);
            var gridItemsLayout = (GridItemsLayout)result;

            Assert.AreEqual(ItemsLayoutOrientation.Horizontal, gridItemsLayout.Orientation);
            Assert.AreEqual(98654, gridItemsLayout.Span);
        }
Пример #4
0
        public void NullShouldThrowArgumentNullException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <ArgumentNullException>(() => converter.ConvertFromInvariantString(null));
        }
Пример #5
0
        public void VerticalGridWithArgumentShouldShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("VerticalList, 2"));
        }
Пример #6
0
        public void EmptyStringShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString(string.Empty));
        }
Пример #7
0
        public void HorizontalGridWithSemicolonShouldShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("HorizontalGrid; 2"));
        }
Пример #8
0
        public void LinearItemsLayoutShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("LinearItemsLayout"));
        }
Пример #9
0
        public void VerticalGridWith2ArgumentsShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("VerticalGrid, 2, 3"));
        }
Пример #10
0
        public void VerticalGridWithSpanIs1point5ShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("VerticalGrid, 1.5"));
        }
Пример #11
0
        public void HorizontalGridWithSpanIsNotStringShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("HorizontalGrid,test"));
        }
Пример #12
0
        public void VerticalGridWithoutSpanShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("VerticalGrid,"));
        }
Пример #13
0
        public void VerticalGridWithSpan0ShouldShouldThrowArgumentException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <ArgumentException>(() => converter.ConvertFromInvariantString("VerticalGrid, 0"));
        }