Exemplo n.º 1
0
        public void RoundtripSerialize()
        {
            var original = ScheduleDefinition.CreateDefinition(
                new GroupRegistrationId("a"),
                BuildSchedule(),
                new Dictionary <ScheduleElementId, ScheduleActionRegistrationId>(),
                new Dictionary <ScheduleElementId, ScheduleConditionRegistrationId>());
            var copy = AssertExtensions.RoundTripSerialize(original);

            Assert.AreEqual(original, copy);
        }
Exemplo n.º 2
0
        public void Create()
        {
            var groupId  = new GroupRegistrationId("a");
            var schedule = BuildSchedule();
            var actions  = new Dictionary <ScheduleElementId, ScheduleActionRegistrationId>
            {
                { new ScheduleElementId(), new ScheduleActionRegistrationId(typeof(string), 0, "a") }
            };
            var conditions = new Dictionary <ScheduleElementId, ScheduleConditionRegistrationId>
            {
                { new ScheduleElementId(), new ScheduleConditionRegistrationId(typeof(string), 0, "a") }
            };
            var obj = ScheduleDefinition.CreateDefinition(
                groupId,
                schedule,
                actions,
                conditions);

            Assert.AreEqual(groupId, obj.ContainingGroup);
            Assert.AreEqual(schedule, obj.Schedule);
            Assert.That(obj.Actions, Is.EquivalentTo(actions));
            Assert.That(obj.Conditions, Is.EquivalentTo(conditions));
        }