public void ShouldThrowArgumentNullException() { Assert.Multiple(() => { Assert.That(() => NotificationMessageFactory.GetToastXml(null, new Uri("http://localhost/")), Throws.ArgumentNullException); Assert.That(() => NotificationMessageFactory.GetToastXml("message", null), Throws.ArgumentNullException); }); }
public void ShouldNotThrowException() { var notifier = ToastNotificationManager.CreateToastNotifier("Website Poller"); var wrapper = new ToastNotifierWrapper(notifier); var toastXml = NotificationMessageFactory.GetToastXml("foo", new Uri("http://localhost/")); var toast = new ToastNotification(toastXml); Assert.That(() => wrapper.Show(toast), Throws.Nothing); notifier.Hide(toast); }
public void ShouldProduceCorrectMessage() { var assemblyPath = An.AssemblyPath(); var path = Path.Combine(assemblyPath, "Workflow", "toast.xml"); var content = File.ReadAllText(path); var result = NotificationMessageFactory.GetToastXml("message", new Uri("http://localhost/")); Assert.That(result, Is.Not.Null); Assert.That(result.GetXml(), Is.EqualTo(content)); }