예제 #1
0
        public void DeleteTriggerQueueService_Execute()
        {
            var serializer = new Dev2JsonSerializer();
            var source     = new TriggerQueueForTest();

            var values = new Dictionary <string, StringBuilder>
            {
                { "TriggerQueue", source.SerializeToJsonStringBuilder() }
            };

            var deleteTriggerQueueService = new SaveTriggerQueueService();

            var jsonResult = deleteTriggerQueueService.Execute(values, null);
            var result     = serializer.Deserialize <ExecuteMessage>(jsonResult);

            Assert.IsFalse(result.HasError);
        }
예제 #2
0
        public void SaveTriggerQueueService_Execute()
        {
            var serializer = new Dev2JsonSerializer();
            var source     = new TriggerQueueForTest();

            var values = new Dictionary <string, StringBuilder>
            {
                { "TriggerQueue", source.SerializeToJsonStringBuilder() }
            };

            var saveTriggerQueueService = new SaveTriggerQueueService();

            var jsonResult = saveTriggerQueueService.Execute(values, null);
            var result     = serializer.Deserialize <ExecuteMessage>(jsonResult);

            Assert.IsFalse(result.HasError);
            var triggerId = Guid.Parse(result.Message.ToString());

            Assert.IsTrue(triggerId != Guid.Empty);
        }