Exemplo n.º 1
0
        public async Task HomeCompositeDataTest()
        {
            using var store   = GetDocumentStore();
            using var session = store.OpenAsyncSession();

            var query = new HomeComposite()
            {
                Session = session, CurrentUser = UserData.GetFirst()
            };
            await query.Execute();

            query.Result.Should().NotBeNull();
            query.Result.Attendances.Count().Should().Be(0);
            query.Result.Msgs.Count().Should().Be(1);
            query.Result.Searchable.Should().BeNullOrEmpty();
            query.Result.Searchable = new List <string> {
                "something!"
            };
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Home()
        {
            const int forward = 8;

            var data = new HomeComposite()
            {
                CurrentUser = CurrentUser, Forward = forward
            };
            await DataHandler.Execute(data);

            var days = new DayDisplay <AttendanceDisplay>()
            {
                DateFrom = DateTime.UtcNow, Days = forward, Source = data.Result.Attendances
            };
            await LogicHandler.Execute(days);

            return(Ok(new HomeViewModel()
            {
                Attendance = days.Result, Msg = data.Result.Msgs, Success = true
            }));
        }