コード例 #1
0
ファイル: CoordinateTest.cs プロジェクト: antgraf/BA
 public void Create()
 {
     Point p = new Point();
     Assert.NotNull(p);
     p.X = 100;
     p.Y = 200;
     StretchedPoint sp = new StretchedPoint();
     Assert.NotNull(sp);
     sp.X = 150.0;
     sp.Y = 250.0;
     Coordinate c0 = new Coordinate();
     Coordinate c1 = new Coordinate(CoordinateType.Absolute, p);
     Coordinate c2 = new Coordinate(CoordinateType.Relative, p);
     Coordinate c3 = new Coordinate(sp);
     Assert.NotNull(c0);
     Assert.NotNull(c1);
     Assert.NotNull(c2);
     Assert.NotNull(c3);
 }
コード例 #2
0
ファイル: CoordinateTest.cs プロジェクト: antgraf/BA
 public void WrongPoint()
 {
     StretchedPoint wrongP1 = new StretchedPoint {X = 100.0, Y = 0.0};
     StretchedPoint wrongP2 = new StretchedPoint {X = 0.0, Y = 100.0};
     StretchedPoint wrongP3 = new StretchedPoint {X = 100.0, Y = 200.0};
     Coordinate c1 = new Coordinate(wrongP1);
     Coordinate c2 = new Coordinate(wrongP2);
     Coordinate c3 = new Coordinate(wrongP3);
     Window w = CreateStdWindow();
     Assert.Catch<CoordinatesOutOfRangeException>(() => c1.ToAbsolute(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c2.ToAbsolute(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c3.ToAbsolute(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c1.ToRelative(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c2.ToRelative(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c3.ToRelative(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c1.ToStretched(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c2.ToStretched(w));
     Assert.Catch<CoordinatesOutOfRangeException>(() => c3.ToStretched(w));
 }