示例#1
0
 public void TouchArea_union_smaller_object_gives_larger()
 {
     TouchArea larger = new TouchArea()
     {
         Type = "Rect",
         Value = "6x4"
     };
     TouchArea smaller = new TouchArea()
     {
         Type = "Rect",
         Value = "2x2"
     };
     TouchArea expected = new TouchArea()
     {
         Type = "Rect",
         Value = "6x4"
     };
     larger.Union(smaller);
     Assert.IsTrue(larger.Equals(expected));
 }
示例#2
0
 public void TouchArea_union_null_throws_exception()
 {
     TouchArea Target = new TouchArea();
     TouchArea input = null;
     Target.Union(input);
 }
示例#3
0
 public void TouchArea_union_gives_largest_values_for_all_dimensions()
 {
     TouchArea target = new TouchArea()
     {
         Type = "Ellipse",
         Value = "2x4"
     };
     TouchArea input = new TouchArea()
     {
         Type = "Ellipse",
         Value = "6x2"
     };
     TouchArea expected = new TouchArea()
     {
         Type = "Ellipse",
         Value = "6x4"
     };
     target.Union(input);
     Assert.IsTrue(target.Equals(expected));
 }
示例#4
0
 public void TouchArea_union_different_type_throws_exception()
 {
     TouchArea target = new TouchArea();
     ClosedLoop input = new ClosedLoop();
     target.Union(input);
 }
示例#5
0
 public void TouchArea_union_different_type_gives_rect()
 {
     TouchArea target = new TouchArea()
     {
         Type = "Circle",
         Value = "4"
     };
     TouchArea input = new TouchArea()
     {
         Type = "Ellipse",
         Value = "2x3"
     };
     TouchArea expected = new TouchArea()
     {
         Type = "Rect",
         Value = "4x4"
     };
     target.Union(input);
     Assert.IsTrue(target.Equals(expected));
 }
示例#6
0
 public void TouchArea_same_types_union_gives_same()
 {
     TouchArea target = new TouchArea()
         {
             Type = "Circle",
             Value = "4"
         };
     TouchArea value = new TouchArea()
         {
             Type = "Circle",
             Value = "6"
         };
     target.Union(value);
     Assert.IsTrue( target.Equals(value));
 }