public static void Clear(IntegrationTestsFixture fixture)
        {
            var deploymentProcessSettings = fixture.Resolve <DeploymentProcessSettings>();
            var workingDir = deploymentProcessSettings.WorkingDir.ToString();

            if (Directory.Exists(workingDir))
            {
                Directory.Delete(workingDir, recursive: true);
            }
        }
Пример #2
0
        public static async Task <int> FindComponentId(this IntegrationTestsFixture fixture, string componentName)
        {
            using var scope = fixture.BeginDbContextScope();

            var dbContext = scope.Resolve <SheepItDbContext>();

            return(await dbContext.Components
                   .Where(component => component.Name == componentName)
                   .Select(component => component.Id)
                   .SingleAsync());
        }
Пример #3
0
        public static async Task <int> FindEnvironmentId(this IntegrationTestsFixture fixture, string environmentName)
        {
            using var scope = fixture.BeginDbContextScope();

            var dbContext = scope.Resolve <SheepItDbContext>();

            return(await dbContext.Environments
                   .Where(environment => environment.DisplayName == environmentName)
                   .Select(environment => environment.Id)
                   .SingleAsync());
        }
Пример #4
0
 public static DateTime GetUtcNow(this IntegrationTestsFixture fixture)
 {
     return(fixture.Resolve <TestClock>().UtcNow);
 }
Пример #5
0
 public static void SetUtcNow(this IntegrationTestsFixture fixture, DateTime dateTime)
 {
     fixture.Resolve <TestClock>().UtcNow = dateTime;
 }
Пример #6
0
        public static void MomentLater(this IntegrationTestsFixture fixture)
        {
            var momentLater = fixture.GetUtcNow().AddMinutes(5);

            fixture.SetUtcNow(momentLater);
        }