public void AddEvent_NegativeTest2() { eventCollection = new EventCollection(); var event1 = GetEvent(); eventCollection.AddEvent(event1); var result = eventCollection.RemoveEvent(event1); Assert.IsTrue(result, "Event remove failed"); }
public void RemoveEvent_NegativeTest2() { eventCollection = new EventCollection(); var event1 = GetEvent(); var result = false; var exceptionType = string.Empty; result = eventCollection.RemoveEvent(event1); Assert.IsFalse(result, "Eventcollection should return false"); }
public void RemoveEvent_NegativeTest1() { eventCollection = new EventCollection(); var event1 = new Mock <IEvent>(); var result = false; var exceptionType = string.Empty; try { eventCollection.RemoveEvent(event1.Object); } catch (ArgumentException) { result = true; } catch (Exception e) { exceptionType = e.GetType().ToString(); } Assert.IsTrue(result, string.Format("Expected Exception ArgumentException not found got {0}", exceptionType)); }