Exemplo n.º 1
0
        public void HorizontalListShouldReturnLinearItemsLayout()
        {
            var converter = new ItemsLayoutTypeConverter();
            var result    = converter.ConvertFromInvariantString("HorizontalList");

            Assert.AreSame(LinearItemsLayout.Horizontal, result);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
        public void NullShouldThrowArgumentNullException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <ArgumentNullException>(() => converter.ConvertFromInvariantString(null));
        }
Exemplo n.º 5
0
        public void VerticalGridWithArgumentShouldShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("VerticalList, 2"));
        }
Exemplo n.º 6
0
        public void EmptyStringShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString(string.Empty));
        }
Exemplo n.º 7
0
        public void HorizontalGridWithSemicolonShouldShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("HorizontalGrid; 2"));
        }
Exemplo n.º 8
0
        public void LinearItemsLayoutShouldThrowInvalidOperationException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("LinearItemsLayout"));
        }
Exemplo n.º 9
0
        public void VerticalGridWith2ArgumentsShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("VerticalGrid, 2, 3"));
        }
Exemplo n.º 10
0
        public void VerticalGridWithSpanIs1point5ShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("VerticalGrid, 1.5"));
        }
Exemplo n.º 11
0
        public void HorizontalGridWithSpanIsNotStringShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("HorizontalGrid,test"));
        }
Exemplo n.º 12
0
        public void VerticalGridWithoutSpanShouldShouldThrowFormatException()
        {
            var converter = new ItemsLayoutTypeConverter();

            Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("VerticalGrid,"));
        }
Exemplo n.º 13
0
        public void VerticalGridWithSpan0ShouldShouldThrowArgumentException()
        {
            var converter = new ItemsLayoutTypeConverter();

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