예제 #1
0
        public static HULAFContext Create()
        {
            var options = new DbContextOptionsBuilder <HULAFContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var context = new HULAFContext(options);

            context.Database.EnsureCreated();

            context.Person.AddRange(new[]
            {
                new Person {
                    PersonGuid = Guid.Parse("{ddf3e819-3caa-46bd-95d8-0a20a1929600}"), ContactInfo = new ContactInfo {
                        ContactInfoGuid = Guid.Parse("{b8296c3e-fd11-421d-961e-1a8de7b4c3b0}"), FirstName = "Béla"
                    }
                }
            });

            context.SaveChanges();

            return(context);
        }
예제 #2
0
 public ApplicationTestsBase()
 {
     this.context = HULAFContextFactory.Create();
 }
예제 #3
0
 public ApplicationTests()
 {
     this.context = new ApplicationTestsBase().TestContext;
 }
예제 #4
0
        public static void Destroy(HULAFContext context)
        {
            context.Database.EnsureDeleted();

            context.Dispose();
        }
예제 #5
0
 public GetMissingPersonQueryHandler(HULAFContext context)
 {
     this.context = context;
     this.mapper  = HulafMapperConfig.HulafMapper;
 }