Esempio n. 1
0
        public void raise_trainingDeleted_on_delete_training()
        {
            var history    = new History();
            var trainingId = Guid.NewGuid();

            history.Add(new TrainingCreated(trainingId, 1, "TED", 1, Color.Empty.ToArgb()));

            var training = new Training(history);

            training.Delete();

            training.UncommitedEvents.GetStream().Should().Contain(new TrainingDeleted(Guid.Empty, 0));
        }
Esempio n. 2
0
        public void dont_raise_trainingDeleted_if_training_already_deleted()
        {
            var history    = new History();
            var trainingId = Guid.NewGuid();

            history.Add(new TrainingCreated(trainingId, 1, "TED", 1, Color.Empty.ToArgb()));
            history.Add(new TrainingDeleted(trainingId, 2));

            var training = new Training(history);

            training.Delete();

            training.UncommitedEvents.GetStream().Should().BeEmpty();
        }