Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 /// <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;
 }