public async Task WhenNoChange_Validates()
        {
            var seedDate        = DateTimeOffset.UtcNow;
            var dateTimeService = new MockDateTimeService(seedDate);

            using var app    = _webApplicationFactory.CreateApp();
            using var client = _webApplicationFactory.CreateClientWithServices(s => s.AddSingleton <IDateTimeService>(dateTimeService));
            var user = app.SeededEntities.TestUserArea1.RoleA.User;

            await client.ImpersonateUserAsync(user);

            dateTimeService.MockDateTime = seedDate.AddMinutes(35);
            var userId = await GetCurrentlySignedInUserId(client);

            userId.Should().Be(user.UserId);
        }
Exemplo n.º 2
0
        public async Task WhenSiteNotSetup_Throws(string path)
        {
            using var client = _webApplicationFactory.CreateClientWithServices(s =>
            {
                s.TurnOnDeveloperExceptionPage();
                s.MockHandler <GetSettingsQuery <InternalSettings>, InternalSettings>(new InternalSettings()
                {
                    IsSetup = false
                });
            });

            var result = await client.GetAsync(path);

            await result.Should().BeDeveloperPageExceptionAsync("*Cofoundry * not * setup*");
        }