Inheritance: ISubscriberService
Beispiel #1
0
        public void ReturningFalseFromScriptReturnsFalseOnReceviedNotificationEvent()
        {
            CreateScript( result: false);
            var subscriber = new Service();
            var notification = SetupExpectedNotification();

            var result = subscriber.SubscriptionEventNotification(notification);

            Assert.IsFalse(result);
        }
Beispiel #2
0
        public void UnknownCommandInScriptReturnsFalseOnReceviedNotificationEventAndWritesToTrace()
        {
            CreateScriptWithUnknownCommand();
            var subscriber = new Service();
            var notification = SetupExpectedNotification();

            var result = subscriber.SubscriptionEventNotification(notification);

            Assert.IsFalse(result);
            Assert.AreEqual(1, TraceLog.Traces.Count());
        }
Beispiel #3
0
        public void CanCallValidPowershellSubscriberScriptOnNotificationEvent()
        {
            CreateScript();
            var subscriber = new Service();
            var notification = SetupExpectedNotification();

            var result = subscriber.SubscriptionEventNotification(notification);

            Assert.AreEqual(ReadFile("expectedhref.txt"), ReadFile("actualhref.txt"));
            Assert.AreEqual(ReadFile("expectedevent.txt"), ReadFile("actualevent.txt"));
            Assert.AreEqual(ReadFile("expectedsubscriptions.txt"), ReadFile("actualsubscriptions.txt"));
            Assert.AreEqual(ReadFile("expectedchanges.txt"), ReadFile("actualchanges.txt"));
            Assert.IsTrue(result);
        }