public void HorizontalListShouldReturnLinearItemsLayout() { var converter = new ItemsLayoutTypeConverter(); var result = converter.ConvertFromInvariantString("HorizontalList"); Assert.AreSame(LinearItemsLayout.Horizontal, result); }
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); }
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); }
public void NullShouldThrowArgumentNullException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <ArgumentNullException>(() => converter.ConvertFromInvariantString(null)); }
public void VerticalGridWithArgumentShouldShouldThrowInvalidOperationException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("VerticalList, 2")); }
public void EmptyStringShouldThrowInvalidOperationException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString(string.Empty)); }
public void HorizontalGridWithSemicolonShouldShouldThrowInvalidOperationException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("HorizontalGrid; 2")); }
public void LinearItemsLayoutShouldThrowInvalidOperationException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("LinearItemsLayout")); }
public void VerticalGridWith2ArgumentsShouldShouldThrowFormatException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("VerticalGrid, 2, 3")); }
public void VerticalGridWithSpanIs1point5ShouldShouldThrowFormatException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("VerticalGrid, 1.5")); }
public void HorizontalGridWithSpanIsNotStringShouldShouldThrowFormatException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <FormatException>(() => converter.ConvertFromInvariantString("HorizontalGrid,test")); }
public void VerticalGridWithoutSpanShouldShouldThrowFormatException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <InvalidOperationException>(() => converter.ConvertFromInvariantString("VerticalGrid,")); }
public void VerticalGridWithSpan0ShouldShouldThrowArgumentException() { var converter = new ItemsLayoutTypeConverter(); Assert.Throws <ArgumentException>(() => converter.ConvertFromInvariantString("VerticalGrid, 0")); }