public async Task A_Invoke_Async_Parameters() { // Arrange var ee = new EventHandler(); var a = new A(ee); // Act await ee.InvokeAsync("SetName", "Test"); // Assert Assert.AreEqual("Test", a.Name); }
public async Task A_Invoke_Async() { // Arrange var ee = new EventHandler(); var a = new A(ee); // Act await ee.InvokeAsync("Update"); // Assert Assert.IsTrue(a.Enabled); Assert.AreEqual(1, a.UpdateCalled); }
public async Task A_Acquire_T_Async() { // Arrange var ee = new EventHandler(); new A(ee); // Act await ee.InvokeAsync("Update"); var result1 = await ee.AcquireAsync <bool>("GetUpdate"); var result2 = await ee.AcquireAsync <int>("GetUpdate"); // Assert CollectionAssert.AreEqual(result1.ToArray(), new bool[] { }); CollectionAssert.AreEqual(result2.ToArray(), new int[] { 1 }); }