public void Evaluating_equals_throws_an_exception_if_the_left_Thumbnail_is_null() { Type expected = typeof(NullReferenceException); string fullSize = "fullSize"; ImagePairNames left = new ImagePairNames(fullSize, null); ImagePairNames right = new ImagePairNames(); try { bool result = left == right; } catch (Exception e) { Assert.AreEqual(expected, e.GetType()); } try { bool result = left != right; } catch (Exception e) { Assert.AreEqual(expected, e.GetType()); } try { bool result = left.Equals(right); } catch (Exception e) { Assert.AreEqual(expected, e.GetType()); } }
public void Evaluating_equals_throws_an_exception_if_the_object_is_not_an_ImagePairNames() { ImagePairNames pair = new ImagePairNames(); object obj = new object(); Assert.Throws <InvalidCastException>(() => pair.Equals(obj)); }
public void Evaluating_equals_throws_an_exception_if_the_object_is_not_an_ImagePairNames() { ImagePairNames pair = new ImagePairNames(); object obj = new object(); pair.Equals(obj); }
public void Two_ImagePairNames_are_not_equal_if_Thumbnail_differs() { string fullSize = "fullSize"; ImagePairNames left = new ImagePairNames(fullSize, "left"); ImagePairNames right = new ImagePairNames(fullSize, "right"); Assert.IsFalse(left == right); Assert.IsTrue(left != right); Assert.IsFalse(left.Equals(right)); }
public void Two_ImagePairNames_are_not_equal_if_FullSize_differs() { string thumbnail = "thumbnail"; ImagePairNames left = new ImagePairNames("left", thumbnail); ImagePairNames right = new ImagePairNames("right", thumbnail); Assert.IsFalse(left == right); Assert.IsTrue(left != right); Assert.IsFalse(left.Equals(right)); }
public void Two_ImagePairNames_are_equal_if_FullSize_and_Thumbnail_match() { string fullSize = "fullSize"; string thumbnail = "thumbnail"; ImagePairNames left = new ImagePairNames(fullSize, thumbnail); ImagePairNames right = new ImagePairNames(fullSize, thumbnail); Assert.IsTrue(left == right); Assert.IsFalse(left != right); Assert.IsTrue(left.Equals(right)); }
public void Evaluating_equals_throws_an_exception_if_the_left_FullSize_is_null() { Type expected = typeof(NullReferenceException); string thumbnail = "thumbnail"; ImagePairNames left = new ImagePairNames(); left.Thumbnail = thumbnail; ImagePairNames right = new ImagePairNames(); try { bool result = left == right; } catch (Exception e) { Assert.AreEqual(expected, e.GetType()); } try { bool result = left != right; } catch (Exception e) { Assert.AreEqual(expected, e.GetType()); } try { bool result = left.Equals(right); } catch (Exception e) { Assert.AreEqual(expected, e.GetType()); } }