public void shouldRaiseWarningEventOnWarning() { GoogleContactService googleContactService = new GoogleContactService(Common.GoogleAuthentication, Common.TestGoogleContactGroupName); GoogleContactService_Accessor googleContactService_acc = new GoogleContactService_Accessor(new PrivateObject(googleContactService)); bool isRaised = false; googleContactService.Warning += (sender, ev) => { Assert.IsTrue(ev.Message.Contains("Warning message")); isRaised = true; }; googleContactService_acc.OnWarning(new WarningEventArgs("Warning message")); Assert.IsTrue(isRaised); }
public void shouldRaiseWarningOnGoogleContactWarning() { GoogleContactService googleContactService = new GoogleContactService(Common.GoogleAuthentication, Common.TestGoogleContactGroupName); GoogleContactService_Accessor googleContactService_acc = new GoogleContactService_Accessor(new PrivateObject(googleContactService)); IAvegaClientRepository avegaClientRepository = new IntranetAvegaClientRepository(Common.AvegaAuthentication); AvegaContactService avegaContactService = new AvegaContactService(googleContactService, avegaClientRepository); bool isRaised = false; avegaContactService.Warning += (sender, ev) => { Assert.IsTrue(ev.Message.Contains("Warning message")); Console.WriteLine(ev.Message); isRaised = true; }; googleContactService_acc.OnWarning(new WarningEventArgs("Warning message")); Assert.IsTrue(isRaised); }