Beispiel #1
0
        public void GetGroupByID_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id   = Guid.NewGuid(),
                Name = "Group1"
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id   = Guid.NewGuid(),
                Name = "Group2"
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity <Group>(group1);
            db1Adapter.AddEntity <Group>(group2);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration <Mock.DB1_Context.Group, Mock.DomainModel.Group>()
            .AddMap(s => s.Id, d => d.ID)
            .AddMap(s => s.Name, d => d.Name);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities <Mock.DomainModel.Group>().FirstOrDefault(g => g.ID == group1.Id);

            Assert.IsNotNull(result, "Event not found");
            Assert.AreEqual(group1.Id, result.ID, "Wrong group");
        }
Beispiel #2
0
        public void TestMappingTwoToOne()
        {
            // Arrange
            IMapper mapper = new Mapper.Mapper();
            mapper.Register<Class1From, Class2From, ClassTo>((p, q) => new ClassTo
                {
                    ValueInt = p.ValueInt,
                    ValueString = p.ValueString + q.ValueString,
                    ValueDouble = q.ValueDouble
                });

            var classFrom1 = new Class1From
                {
                    ValueInt = ConstValueInt,
                    ValueString = ConstValueString1
                };

            var classFrom2 = new Class2From
                {
                    ValueDouble = ConstValueDouble,
                    ValueString = ConstValueString2
                };

            // Act
            ClassTo classTo = mapper.Map<Class1From, Class2From, ClassTo>(classFrom1, classFrom2);

            // Assert
            Assert.IsNotNull(classTo);
            Assert.AreEqual(classTo.ValueInt, 3);
            Assert.AreEqual(classTo.ValueDouble, ConstValueDouble);
            Assert.AreEqual(classTo.ValueString, ConstValueString1 + ConstValueString2);
        }
Beispiel #3
0
        public void TestMappingOneToOne()
        {
            // Arrange
            IMapper mapper = new Mapper.Mapper();

            mapper.Register <Class1From, ClassTo>(p => new ClassTo
            {
                ValueInt    = p.ValueInt,
                ValueString = p.ValueString
            });

            var classFrom = new Class1From
            {
                ValueInt    = ConstValueInt,
                ValueString = ConstValueString1
            };

            // Act
            ClassTo classTo = mapper.Map <Class1From, ClassTo>(classFrom);

            // Assert
            Assert.IsNotNull(classTo);
            Assert.AreEqual(classTo.ValueInt, ConstValueInt);
            Assert.AreEqual(classTo.ValueString, ConstValueString1);
        }
        //
        // GET: /Analysis/Details/5

        public ActionResult Details(int id = 0)
        {
            analysis analysis = db.analyses.Find(id);

            if (analysis == null)
            {
                return(HttpNotFound());
            }
            if (Request.IsAjaxRequest())
            {
                ViewBag.Scans  = analysis.antivirus_scan.AsPagination(1, 1000000);
                ViewBag.Dns    = analysis.dns.AsPagination(1, 1000000);
                ViewBag.Images = analysis.result_file;
                ViewBag.Events = analysis.computer_event.AsPagination(1, 1000000);;
                return(PartialView("_Dynamic", analysis));
            }
            else
            {
                Mapper.Mapper      mapper = new Mapper.Mapper();
                IPagination <Info> infos  = mapper.HashMapper(analysis.file_detail).AsPagination(1, 100);
                ViewBag.Infos = infos;
                IPagination <import_function> imports = analysis.file_detail.pe_file.import_function.OrderBy(p => p.import_library.name).AsPagination(1, 1000000);
                ViewBag.Imports = imports;
                IPagination <export_function> exports = analysis.file_detail.pe_file.export_function.OrderBy(p => p.name).AsPagination(1, 1000000);
                ViewBag.Exports = exports;
                IPagination <resource> resources = analysis.file_detail.pe_file.resources.OrderBy(p => p.id).AsPagination(1, 1000000);
                ViewBag.Resources = resources;
                IPagination <section> sections = analysis.file_detail.pe_file.sections.OrderBy(p => p.id).AsPagination(1, 1000000);
                ViewBag.Section = sections;
                IPagination <miscellaneous> misc = analysis.miscellaneous.OrderBy(p => p.type).AsPagination(1, 1000000);
                ViewBag.Miscellaneous = misc;
                return(View(analysis));
            }
        }
Beispiel #5
0
        public void GetGroup_GroupFromDB1_GroupWithAttributeWithoutSourceClass()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id   = Guid.NewGuid(),
                Name = "Group1"
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id   = Guid.NewGuid(),
                Name = "Group2"
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity <Group>(group1);
            db1Adapter.AddEntity <Group>(group2);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration <Mock.DB1_Context.Group, Mock.DomainModel.GroupWitoutSourceClass>()
            .AddMap(s => s.Id, d => d.ID)
            .AddMap(s => s.Name, d => d.Name);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities <Mock.DomainModel.GroupWitoutSourceClass>().FirstOrDefault();
        }
Beispiel #6
0
        public void TestMappingTwoToOne()
        {
            // Arrange
            IMapper mapper = new Mapper.Mapper();

            mapper.Register <Class1From, Class2From, ClassTo>((p, q) => new ClassTo
            {
                ValueInt    = p.ValueInt,
                ValueString = p.ValueString + q.ValueString,
                ValueDouble = q.ValueDouble
            });

            var classFrom1 = new Class1From
            {
                ValueInt    = ConstValueInt,
                ValueString = ConstValueString1
            };

            var classFrom2 = new Class2From
            {
                ValueDouble = ConstValueDouble,
                ValueString = ConstValueString2
            };

            // Act
            ClassTo classTo = mapper.Map <Class1From, Class2From, ClassTo>(classFrom1, classFrom2);

            // Assert
            Assert.IsNotNull(classTo);
            Assert.AreEqual(classTo.ValueInt, 3);
            Assert.AreEqual(classTo.ValueDouble, ConstValueDouble);
            Assert.AreEqual(classTo.ValueString, ConstValueString1 + ConstValueString2);
        }
Beispiel #7
0
        /// <summary>
        /// Creates new instance of repository.
        /// </summary>
        public Repository()
        {
            //creating DAL instance
            this.dataAccessor = new DAL();

            //creating mapper
            this.mapper = new Mapper.Mapper();
        }
Beispiel #8
0
        public ParticularMaterialModel GetMaterialById(Guid id)
        {
            Mapper.Mapper           mapper   = new Mapper.Mapper();
            var                     versions = _db.MaterialVersions.Where(x => x.MaterialId == id).ToList();
            ParticularMaterialModel material = new ParticularMaterialModel()
            {
                MaterialId            = id,
                MaterialVersionModels = mapper.MapMaterialVersion(versions)
            };

            return(material);
        }
Beispiel #9
0
        static void Main(string[] args)
        {
            TEST_ONE testOneDb = new TEST_ONE();

            DataGenerator(testOneDb);

            using (Mapper.Mapper <TEST_ONE, TestOne> _mapper = new Mapper.Mapper <TEST_ONE, TestOne>(Mapper.Enumerators.MapperTypeEnum.ConventionBasedMapper))
            {
                _mapper.CreateMapDto(x => x.NameAndLastName, x => { return(x.ID + ":" + x.NAME_AND_LAST_NAME); });
                //_mapper.CreateMapDatabase(x => x.NAME_AND_LAST_NAME, x => { return x.NameAndLastName.Substring(0,2); });

                var result = _mapper.ToDto(testOneDb);
            }
        }
Beispiel #10
0
        public void GetGroupsSelectNewEntity_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group1",
                Number = 1
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group2",
                Number = 1
            };
            var group3 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group3",
                Number = 2
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity <Group>(group1);
            db1Adapter.AddEntity <Group>(group2);
            db1Adapter.AddEntity <Group>(group3);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration <Mock.DB1_Context.Group, Mock.DomainModel.Group>()
            .AddMap(s => s.Id, d => d.ID)
            .AddMap(s => s.Name, d => d.Name)
            .AddMap(s => s.Number, d => d.Number);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities <Mock.DomainModel.Group>()
                         .Select(g => new { g.ID, g.Number })
                         .ToList();

            Assert.IsTrue(result.Any(r => r.ID == group1.Id), "group1 is not found");
            Assert.IsTrue(result.Any(r => r.ID == group2.Id), "group2 is not found");
            Assert.IsTrue(result.Any(r => r.ID == group3.Id), "group3 is not found");
        }
Beispiel #11
0
        public Form1()
        {
            InitializeComponent();
            mapper = new Mapper.Mapper();
            Mapper.Mapper.NotificationIcon = notificationIcon;

            UpdateProcessList();
            Draw();
            // TODO: Rework Interface-update routine (seperate each process and device to be able to structurally and cosmetically update itself)

            Console.WriteLine("Done!");
            MidiInit();
            mapper.SetDeviceInterface(deviceinterface);
            mapper.SetMappingMidi();
            mapper.ResetColors();
        }
Beispiel #12
0
        public void GetGroupsByNumberAndIdDoubleWhere_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group1",
                Number = 1
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group2",
                Number = 1
            };
            var group3 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group3",
                Number = 2
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity <Group>(group1);
            db1Adapter.AddEntity <Group>(group2);
            db1Adapter.AddEntity <Group>(group3);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration <Mock.DB1_Context.Group, Mock.DomainModel.Group>()
            .AddMap(s => s.Id, d => d.ID)
            .AddMap(s => s.Name, d => d.Name)
            .AddMap(s => s.Number, d => d.Number);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities <Mock.DomainModel.Group>()
                         .Where(g => g.Number == group1.Number)
                         .Where(g => g.ID == group1.Id)
                         .First();

            Assert.AreEqual(group1.Id, result.ID, "Wrong groups count");
        }
Beispiel #13
0
        public void GetGroupsWhereNumberEqual1_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group1",
                Number = 1
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group2",
                Number = 1
            };
            var group3 = new Mock.DB1_Context.Group()
            {
                Id     = Guid.NewGuid(),
                Name   = "Group3",
                Number = 2
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity <Group>(group1);
            db1Adapter.AddEntity <Group>(group2);
            db1Adapter.AddEntity <Group>(group3);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration <Mock.DB1_Context.Group, Mock.DomainModel.Group>()
            .AddMap(s => s.Id, d => d.ID)
            .AddMap(s => s.Name, d => d.Name)
            .AddMap(s => s.Number, d => d.Number);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities <Mock.DomainModel.Group>().Where(g => g.Number == 1).ToList();

            Assert.AreEqual(2, result.Count(), "Wrong groups count");
            Assert.IsFalse(result.Any(g => g.Number != 1), "Wrong group returned");
        }
Beispiel #14
0
        public void TestMappingOneToOne()
        {
            // Arrange
            IMapper mapper = new Mapper.Mapper();
            mapper.Register<Class1From, ClassTo>(p => new ClassTo
                {
                    ValueInt = p.ValueInt,
                    ValueString = p.ValueString
                });

            var classFrom = new Class1From
                {
                    ValueInt = ConstValueInt,
                    ValueString = ConstValueString1
                };

            // Act
            ClassTo classTo = mapper.Map<Class1From, ClassTo>(classFrom);

            // Assert
            Assert.IsNotNull(classTo);
            Assert.AreEqual(classTo.ValueInt, ConstValueInt);
            Assert.AreEqual(classTo.ValueString, ConstValueString1);
        }
        public void GetGroupsSelectNewEntity_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group1",
                Number = 1
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group2",
                Number = 1
            };
            var group3 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group3",
                Number = 2
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity<Group>(group1);
            db1Adapter.AddEntity<Group>(group2);
            db1Adapter.AddEntity<Group>(group3);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration<Mock.DB1_Context.Group, Mock.DomainModel.Group>()
                .AddMap(s => s.Id, d => d.ID)
                .AddMap(s => s.Name, d => d.Name)
                .AddMap(s => s.Number, d => d.Number);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities<Mock.DomainModel.Group>()
                .Select(g => new { g.ID, g.Number })
                .ToList();

            Assert.IsTrue(result.Any(r => r.ID == group1.Id), "group1 is not found");
            Assert.IsTrue(result.Any(r => r.ID == group2.Id), "group2 is not found");
            Assert.IsTrue(result.Any(r => r.ID == group3.Id), "group3 is not found");
        }
 internal CQProvider(Mapper.Mapper mapper, params IDataAdapter[] dataAdapters)
 {
     _mapper       = mapper;
     _dataAdapters = dataAdapters;
 }
Beispiel #17
0
        public void GetEventByGroupID_GroupFromDB1_EventFromDB2()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id   = Guid.NewGuid(),
                Name = "Group1"
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id   = Guid.NewGuid(),
                Name = "Group2"
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity <Group>(group1);
            db1Adapter.AddEntity <Group>(group2);
            db1Adapter.SaveChanges();

            #region Mock.DB_2_Entities.Events Initialize

            var event1 = new Mock.DB2_Context.Event()
            {
                Id        = Guid.NewGuid(),
                Name      = "eventForGroup1",
                GroupName = group1.Name
            };

            var event2 = new Mock.DB2_Context.Event()
            {
                Id        = Guid.NewGuid(),
                Name      = "eventForGroup2",
                GroupName = group2.Name
            };

            #endregion

            var db2Adapter = new DB2Adapter();
            db2Adapter.AddEntity <Event>(event1);
            db2Adapter.AddEntity <Event>(event2);
            db2Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration <Mock.DB1_Context.Group, Mock.DomainModel.Group>()
            .AddMap(s => s.Id, d => d.ID)
            .AddMap(s => s.Name, d => d.Name);

            mapper.CreateConfiguration <Mock.DB2_Context.Event, Mock.DomainModel.Event>()
            .AddMap(s => s.Id, d => d.ID)
            .AddMap(s => s.Name, d => d.Name);

            var cqContext = new CQContext(mapper, db1Adapter, db2Adapter);

            var result = cqContext.GetEntities <Mock.DomainModel.Event>().FirstOrDefault(e => e.Group.ID == group1.Id);

            Assert.IsNotNull(result, "Event not found");
            Assert.AreEqual(event1.Id, result.ID, "Wrong event");
        }
Beispiel #18
0
 public CQContext(Mapper.Mapper mapper, params IDataAdapter[] dataAdapters)
 {
     _mapper   = mapper;
     _provider = new CQProvider(_mapper, dataAdapters);
 }
        public void GetGroupByID_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group1"
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group2"
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity<Group>(group1);
            db1Adapter.AddEntity<Group>(group2);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration<Mock.DB1_Context.Group, Mock.DomainModel.Group>()
                .AddMap(s => s.Id, d => d.ID)
                .AddMap(s => s.Name, d => d.Name);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities<Mock.DomainModel.Group>().FirstOrDefault(g => g.ID == group1.Id);

            Assert.IsNotNull(result, "Event not found");
            Assert.AreEqual(group1.Id, result.ID, "Wrong group");
        }
        public void GetGroup_GroupWithAttributeWithoutAdapterName_AdapterNameIsNull()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group1"
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group2"
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity<Group>(group1);
            db1Adapter.AddEntity<Group>(group2);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration<Mock.DB1_Context.Group, Mock.DomainModel.GroupWitoutSourceClass>()
                .AddMap(s => s.Id, d => d.ID)
                .AddMap(s => s.Name, d => d.Name);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities<Mock.DomainModel.GroupAdapterNameNull>().FirstOrDefault();
        }
        public void GetGroupsWhereNumberEqual1_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group1",
                Number = 1
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group2",
                Number = 1
            };
            var group3 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group3",
                Number = 2
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity<Group>(group1);
            db1Adapter.AddEntity<Group>(group2);
            db1Adapter.AddEntity<Group>(group3);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration<Mock.DB1_Context.Group, Mock.DomainModel.Group>()
                .AddMap(s => s.Id, d => d.ID)
                .AddMap(s => s.Name, d => d.Name)
                .AddMap(s => s.Number, d => d.Number);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities<Mock.DomainModel.Group>().Where(g => g.Number == 1).ToList();

            Assert.AreEqual(2, result.Count(), "Wrong groups count");
            Assert.IsFalse(result.Any(g => g.Number != 1), "Wrong group returned");
        }
Beispiel #22
0
 public Store(EfKeeper keeper, Mapper.Mapper mapper)
 {
     _dbContext = keeper.DbContext;
     Mapper     = mapper;
 }
        public void GetEventByGroupID_GroupFromDB1_EventFromDB2()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group1"
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group2"
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity<Group>(group1);
            db1Adapter.AddEntity<Group>(group2);
            db1Adapter.SaveChanges();

            #region Mock.DB_2_Entities.Events Initialize

            var event1 = new Mock.DB2_Context.Event()
            {
                Id = Guid.NewGuid(),
                Name = "eventForGroup1",
                GroupName = group1.Name
            };

            var event2 = new Mock.DB2_Context.Event()
            {
                Id = Guid.NewGuid(),
                Name = "eventForGroup2",
                GroupName = group2.Name
            };

            #endregion

            var db2Adapter = new DB2Adapter();
            db2Adapter.AddEntity<Event>(event1);
            db2Adapter.AddEntity<Event>(event2);
            db2Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration<Mock.DB1_Context.Group, Mock.DomainModel.Group>()
                .AddMap(s => s.Id, d => d.ID)
                .AddMap(s => s.Name, d => d.Name);

            mapper.CreateConfiguration<Mock.DB2_Context.Event, Mock.DomainModel.Event>()
                .AddMap(s => s.Id, d => d.ID)
                .AddMap(s => s.Name, d => d.Name);

            var cqContext = new CQContext(mapper, db1Adapter, db2Adapter);

            var result = cqContext.GetEntities<Mock.DomainModel.Event>().FirstOrDefault(e => e.Group.ID == group1.Id);

            Assert.IsNotNull(result, "Event not found");
            Assert.AreEqual(event1.Id, result.ID, "Wrong event");
        }
        public void GetGroupsByNumberAndIdWhereWithAnd_GroupFromDB1()
        {
            #region Mock.DB_1_Entities.Groups Initialize

            var group1 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group1",
                Number = 1
            };
            var group2 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group2",
                Number = 1
            };
            var group3 = new Mock.DB1_Context.Group()
            {
                Id = Guid.NewGuid(),
                Name = "Group3",
                Number = 2
            };

            #endregion

            var db1Adapter = new DB1Adapter();
            db1Adapter.AddEntity<Group>(group1);
            db1Adapter.AddEntity<Group>(group2);
            db1Adapter.AddEntity<Group>(group3);
            db1Adapter.SaveChanges();

            var mapper = new Mapper.Mapper();

            mapper.CreateConfiguration<Mock.DB1_Context.Group, Mock.DomainModel.Group>()
                .AddMap(s => s.Id, d => d.ID)
                .AddMap(s => s.Name, d => d.Name)
                .AddMap(s => s.Number, d => d.Number);

            var cqContext = new CQContext(mapper, db1Adapter);

            var result = cqContext.GetEntities<Mock.DomainModel.Group>()
                .Where(g => g.Number == group1.Number && g.ID == group1.Id).First();

            Assert.AreEqual(group1.Id, result.ID, "Wrong group returned");
        }