public void BeforeTest() { var builder = new DbContextOptionsBuilder <DrawingContext>(); builder.EnableSensitiveDataLogging(); builder.UseInMemoryDatabase("testdrawing"); var context = new DrawingContext(builder.Options); this.repository = new DrawingRepository(context); // Pack to draw in tests var text = File.ReadAllText("Models/TestData/pack.json"); this.pack = JsonSerializer.Deserialize <Pack.Pack>(text); }
/// <summary> /// Initialises a new instance of the <see cref="Drawing" /> class. /// </summary> /// /// <param name="pack"> The pack. </param> public Drawing(Pack.Pack pack) : this() { this.Packs[0] = pack; }