Пример #1
0
        public async Task when_user_is_created_it_is_present_in_view()
        {
            await Apply(new UserEvents.UserCreated("JohnDoe"));

            var optional = await CreatedUsersViewProjection.Fetch(string.Empty);

            optional.Value.Users.Should().Contain("JohnDoe");
        }
Пример #2
0
        public async Task when_same_user_is_created_two_times_it_is_not_duplicated_in_view()
        {
            await Apply(new UserEvents.UserCreated("JohnDoe"));
            await Apply(new UserEvents.UserCreated("JohnDoe"));

            var optional = await CreatedUsersViewProjection.Fetch(string.Empty);

            optional.Value.Users.Should().ContainSingle("JohnDoe");
        }
Пример #3
0
        public async Task when_no_events_are_applied_view_returns_empty_list()
        {
            var optional = await CreatedUsersViewProjection.Fetch(string.Empty);

            optional.Value.Users.Should().BeEmpty();
        }
Пример #4
0
        public async Task when_no_events_are_applied_view_exists()
        {
            var optional = await CreatedUsersViewProjection.Fetch(string.Empty);

            optional.HasValue.Should().BeTrue();
        }