示例#1
0
        public static List <TestCase> CreateMany(List <string> testCaseCategoryNames)
        {
            var fixture = FixtureFactory.Create();

            fixture.Customize <TestCase>(tc => tc.With(x => x.Categories, testCaseCategoryNames));

            var result = fixture.CreateMany <TestCase>();

            return(result.ToList());
        }
示例#2
0
        public static IQueryable <TestRunLogDto> CreateMany(Guid testRunId, TestRunLogStatus testRunLogStatus = TestRunLogStatus.Published, int count = 3)
        {
            var fixture = FixtureFactory.Create();

            fixture.Customize <TestRunLogDto>(tr => tr.With(x => x.TestRunId, testRunId).With(x => x.Status, testRunLogStatus));

            var result = fixture.CreateMany <TestRunLogDto>(count).AsQueryable();

            return(result);
        }
示例#3
0
        public static IQueryable <TestRunDto> CreateMany(Guid testRunId)
        {
            var fixture = FixtureFactory.Create();

            fixture.Customize <TestRunDto>(tr => tr.With(x => x.TestRunId, testRunId));

            var result = fixture.CreateMany <TestRunDto>().AsQueryable();

            return(result);
        }
示例#4
0
        public static IQueryable <TestRunDto> CreateSingleInProgress(Guid testRunId)
        {
            var fixture = FixtureFactory.Create();

            fixture.Register(() => TestRunStatus.InProgress);
            fixture.Customize <TestRunDto>(tr => tr.With(x => x.TestRunId, testRunId));

            var result = fixture.CreateMany <TestRunDto>(1).AsQueryable();

            return(result);
        }
示例#5
0
        public static IQueryable <TestAgentRunDto> CreateSingle(Guid testRunId, TestAgentRunStatus status, int testAgentId, int testAgentRunId)
        {
            var fixture = FixtureFactory.Create();

            fixture.Register(() => status);
            fixture.Customize <TestAgentRunDto>(ta => ta.With(x => x.TestRunId, testRunId).With(x => x.TestAgentId, testAgentId).With(x => x.TestAgentRunId, testAgentRunId));

            var result = fixture.CreateMany <TestAgentRunDto>(1).AsQueryable();

            return(result);
        }
示例#6
0
        public static List <TestCase> CreateManyWithSingleMachineCategory(int testCasesCount)
        {
            var fixture            = FixtureFactory.Create();
            var testCaseCategories = fixture.CreateMany <string>().ToList();

            testCaseCategories.Add(singleMachineTestCaseCategory);

            fixture.Customize <TestCase>(ts => ts.With(x => x.Categories, testCaseCategories));

            var result = fixture.CreateMany <TestCase>(testCasesCount);

            return(result.ToList());
        }
示例#7
0
        public static List <TestCase> CreateSingleWithManyTestCasesOnlyOneTestCaseWithCategory(string testCaseCategoryName)
        {
            var testCaseCategories = new List <string> {
                testCaseCategoryName
            };
            var fixture = FixtureFactory.Create();

            fixture.Customize <TestCase>(tc => tc.With(x => x.Categories, testCaseCategories));

            var result = fixture.CreateMany <TestCase>(1);

            return(result.ToList());
        }
示例#8
0
        public static IQueryable <TestAgentRunDto> CreateManyCompletedAndManyAborted(Guid testRunId)
        {
            var fixture = FixtureFactory.Create();

            fixture.Customize <TestAgentRunDto>(ta => ta.With(x => x.TestRunId, testRunId));
            fixture.Register(() => TestAgentRunStatus.Completed);

            var completedTestAgentRuns = fixture.CreateMany <TestAgentRunDto>();

            fixture.Register(() => TestAgentRunStatus.Aborted);
            var abortedTestAgentRuns = fixture.CreateMany <TestAgentRunDto>();

            return(completedTestAgentRuns.Union(abortedTestAgentRuns).AsQueryable());
        }