Exemple #1
0
        public void HorizontalListShouldReturnLinearItemsLayout()
        {
            var converter = new ItemsLayoutTypeConverter();
            var result    = converter.ConvertFromInvariantString("HorizontalList");

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

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

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

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

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

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

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

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

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

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

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