예제 #1
0
        public void Should_throw_exception_when_already_activated()
        {
            var theme = new Theme();

            theme.Activate();

            Assert.Throws <Exception>(() => theme.Activate());
        }
예제 #2
0
        public void Should_set_theme_status_to_activated()
        {
            var theme = new Theme();

            theme.Activate();

            Assert.AreEqual(true, theme.Status == ThemeStatus.Active);
        }
예제 #3
0
        public void Should_set_id_in_theme_activated_event()
        {
            var theme = new Theme();

            theme.Activate();

            var @event = theme.Events.OfType <ThemeActivated>().SingleOrDefault();

            Assert.AreEqual(theme.Id, @event.AggregateRootId);
        }
예제 #4
0
        public void Should_add_theme_activated_event()
        {
            var theme = new Theme();

            theme.Activate();

            var @event = theme.Events.OfType <ThemeActivated>().SingleOrDefault();

            Assert.IsNotNull(@event);
        }