Example #1
0
 /*
  * Getter of the context instance.
  */
 public static SingletonTestSetup Instance()
 {
     if (instance == null)
     {
         instance = new SingletonTestSetup();
     }
     return(instance);
 }
Example #2
0
            public void Setup()
            {
                _db  = SingletonTestSetup.Instance().Get();
                repo = new Repo(_db);

                powderInfo = new StaticPowderInfo
                {
                    StaticPowderInfoId = Guid.NewGuid(),
                    EndlasDescription  = "TestPowder",
                    Density            = 1f,
                };
                _db.StaticPowderInfo.Add(powderInfo);
                _db.SaveChanges();

                vendor = new Vendor
                {
                    VendorId       = Guid.NewGuid(),
                    VendorName     = "Name",
                    PointOfContact = "POC",
                    VendorAddress  = "Address",
                    VendorPhone    = "Phone"
                };
                _db.Vendors.Add(vendor);
                _db.SaveChanges();

                powderOrderGood = new PowderOrder
                {
                    PowderOrderId     = Guid.NewGuid(),
                    PurchaseOrderDate = DateTime.Now,
                    PurchaseOrderNum  = "",
                    ShippingCost      = 0.0f,
                    TaxCost           = 0.0f,
                    Vendor            = vendor,
                    VendorId          = vendor.VendorId,
                };
                _db.PowderOrders.Add(powderOrderGood);

                powderOrderBad = new PowderOrder
                {
                    PowderOrderId     = Guid.NewGuid(),
                    PurchaseOrderDate = DateTime.Now,
                    PurchaseOrderNum  = "",
                    ShippingCost      = 0.0f,
                    TaxCost           = 0.0f,
                    Vendor            = vendor,
                    VendorId          = vendor.VendorId,
                };
                _db.PowderOrders.Add(powderOrderBad);
                _db.SaveChanges();
            }
Example #3
0
 public void Setup()
 {
     _db = SingletonTestSetup.Instance().Get();
 }