public void LinkFromStartWithoutCondition()
        {
            var owner = new Mock <IOwnScheduleDefinitions>();

            var scheduleBuilder = new Mock <IBuildFixedSchedules>();
            {
                scheduleBuilder.Setup(
                    s => s.LinkFromStart(
                        It.IsAny <IScheduleVertex>(),
                        It.IsAny <ScheduleElementId>()))
                .Callback <IScheduleVertex, ScheduleElementId>(
                    (e, c) => Assert.IsNull(c));
            }

            var builder = new ScheduleDefinitionBuilder(owner.Object, scheduleBuilder.Object);

            builder.LinkFromStart(new MarkHistoryVertex(0));
        }
        public void LinkFromStartWithCondition()
        {
            var owner = new Mock <IOwnScheduleDefinitions>();

            ScheduleElementId id = null;
            var scheduleBuilder  = new Mock <IBuildFixedSchedules>();
            {
                scheduleBuilder.Setup(
                    s => s.LinkFromStart(
                        It.IsAny <IScheduleVertex>(),
                        It.IsAny <ScheduleElementId>()))
                .Callback <IScheduleVertex, ScheduleElementId>(
                    (e, c) => id = c);
            }

            var builder = new ScheduleDefinitionBuilder(owner.Object, scheduleBuilder.Object);

            var condition = new ScheduleConditionRegistrationId(typeof(string), 0, "a");

            builder.LinkFromStart(new InsertVertex(1), condition);

            Assert.IsNotNull(id);
        }
        public void LinkFromStartWithoutCondition()
        {
            var owner = new Mock<IOwnScheduleDefinitions>();

            var scheduleBuilder = new Mock<IBuildFixedSchedules>();
            {
                scheduleBuilder.Setup(
                        s => s.LinkFromStart(
                            It.IsAny<IScheduleVertex>(),
                            It.IsAny<ScheduleElementId>()))
                    .Callback<IScheduleVertex, ScheduleElementId>(
                        (e, c) => Assert.IsNull(c));
            }

            var builder = new ScheduleDefinitionBuilder(owner.Object, scheduleBuilder.Object);
            builder.LinkFromStart(new MarkHistoryVertex(0));
        }
        public void LinkFromStartWithCondition()
        {
            var owner = new Mock<IOwnScheduleDefinitions>();

            ScheduleElementId id = null;
            var scheduleBuilder = new Mock<IBuildFixedSchedules>();
            {
                scheduleBuilder.Setup(
                        s => s.LinkFromStart(
                            It.IsAny<IScheduleVertex>(),
                            It.IsAny<ScheduleElementId>()))
                    .Callback<IScheduleVertex, ScheduleElementId>(
                        (e, c) => id = c);
            }

            var builder = new ScheduleDefinitionBuilder(owner.Object, scheduleBuilder.Object);

            var condition = new ScheduleConditionRegistrationId(typeof(string), 0, "a");
            builder.LinkFromStart(new InsertVertex(1), condition);

            Assert.IsNotNull(id);
        }