Exemplo n.º 1
0
        public void ScheduleMessage(string date, string from, string to, string message)
        {
            ScheduledMessagesSubscriptionStore <ScheduledMessage> subscriptionStore = new ScheduledMessagesSubscriptionStore <ScheduledMessage>($@"D:\_projects\Saturnin\botnet\bin\Debug\ScheduledMessages.json");

            subscriptionStore.Add(new ScheduledMessage()
            {
                groupId       = null,
                messageText   = message,
                recipient     = to,
                sender        = from,
                scheduledTime = DateTime.MaxValue
            });
        }
Exemplo n.º 2
0
        public void RemoveMessage(string date, string from, string to, string message)
        {
            var store = new ScheduledMessagesSubscriptionStore <ScheduledMessage>($@"D:\_projects\Saturnin\botnet\bin\Debug\ScheduledMessages.json");

            var removingMessage = new ScheduledMessage()
            {
                groupId       = null,
                messageText   = message,
                recipient     = to,
                sender        = from,
                scheduledTime = DateTime.MaxValue
            };

            store.Remove(removingMessage);

            Assert.IsEmpty(store.GetAll());
        }