void CreateClassWithOneEvent() { // Define imports. string code = "from MyNamespace import MyClass"; resolverHelper = new PythonResolverTestsHelper(code); myClass = resolverHelper.CreateClass("MyClass"); myClassEvent = myClass.AddEvent("MyEvent"); AddEventHandlerClass(); resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyNamespace.MyClass", myClass); }
public void AddEvent_PassedEventName_ReturnsEventWithExpectedName() { MockClass c = new MockClass(); IEvent myEvent = c.AddEvent("MyEvent"); string name = myEvent.Name; Assert.AreEqual("MyEvent", name); }
public void AddEvent_PassedEventName_AddsEventToClass() { MockClass c = new MockClass(); c.AddEvent("MyEvent"); IEvent myEvent = c.Events[0]; string name = myEvent.Name; Assert.AreEqual("MyEvent", name); }