public void Init()
        {
            ICollection<UnitTestSolution> unitTestList = new HashSet<UnitTestSolution>
            {
                new UnitTestSolution() {Id = 1, SetupSolutionId = 1, SetupSolution = new SetupSolution(){ Id = 1, Name = "S1"} },
                new UnitTestSolution() {Id = 2, SetupSolutionId = 2, SetupSolution = new SetupSolution(){ Id = 2, Name = "S2"} },
                new UnitTestSolution() {Id = 3, SetupSolutionId = 3, SetupSolution = new SetupSolution(){ Id = 3, Name = "S3"} },
                new UnitTestSolution() {Id = 4, SetupSolutionId = 4, SetupSolution = new SetupSolution(){ Id = 4, Name = "S4"} },
                new UnitTestSolution() {Id = 5, SetupSolutionId = 5, SetupSolution = new SetupSolution(){ Id = 5, Name = "S5"} }
            };

            MockContext = EntityFrameworkMockHelper.GetMockContext<IDbContext>();
            MockContext.Object.UnitTestSolutions.AddRange(unitTestList);
            Service = new DbRepository(MockContext.Object);
        }
Beispiel #2
0
        public void Init()
        {
            ICollection<SetupSolution> SolutionsData = new HashSet<SetupSolution>
            {
                new SetupSolution() {Id = 2, Name = "12ok"},
                new SetupSolution() {Id = 1, Name = "1"}
            };

            ICollection<UnitTestSolution> UnitSolutionsData = new HashSet<UnitTestSolution>
            {
                new UnitTestSolution() {Id = 1, Name = "1", SetupSolutionId = 1},
                new UnitTestSolution() {Id = 2, Name = "2", SetupSolutionId = 2}
            };

            ICollection<Reference> References = new HashSet<Reference>
            {
                new Reference() {Id = 1, Name = "System.dll"},
                new Reference() {Id = 2, Name = "System.Web.dll"}
            };

            ICollection<Item> ItemsData = new HashSet<Item>
            {
                new Item() {Id = 2, Name = "12ok"}
            };

            ICollection<Class> ClassesData = new HashSet<Class>
            {
                new Class() {Id = 2, Name = "12ok"}
            };

            ICollection<Method> MethodsData = new HashSet<Method>
            {
                new Method() {Id = 2, Name = "12ok"}
            };

            ICollection<Test> TestsData = new HashSet<Test>
            {
                new Test() {Id = 2, Name = "12ok"}
            };

            MockContext = EntityFrameworkMockHelper.GetMockContext<IDbContext>();
            MockContext.Object.SetupSolutions.AddRange(SolutionsData);
            MockContext.Object.UnitTestSolutions.AddRange(UnitSolutionsData);
            MockContext.Object.References.AddRange(References);
            MockContext.Object.Items.AddRange(ItemsData);
            MockContext.Object.Classes.AddRange(ClassesData);
            MockContext.Object.Methods.AddRange(MethodsData);
            MockContext.Object.Tests.AddRange(TestsData);

            Service = new DbRepository(MockContext.Object);
        }