コード例 #1
0
        public void TestUpdateBrand()
        {
            ContextSeeder.Seed();
            var bo      = new BrandBusinessObject();
            var resList = bo.List();
            var item    = resList.Result.FirstOrDefault();

            item.Name = "It's just wine";
            var resUpdate  = bo.Update(item);
            var resNotList = bo.ListNotDeleted().Result;

            Assert.IsTrue(resUpdate.Success && resNotList.First().Name == "It's just wine");
        }
コード例 #2
0
        public void TestCreateSameBarCodeProductModel()
        {
            ContextSeeder.Seed();
            var braBo = new BrandBusinessObject();
            var bra   = braBo.ListNotDeleted().Result.First();
            var catBo = new CategoryBusinessObject();
            var cat   = catBo.ListNotDeleted().Result.First();

            var bo        = new ProductModelBusinessObject();
            var prodMod   = new ProductModel("Vinho Branco", "506-1237-422", "", 4.24, 0.80, Measure.L, bra.Id, cat.Id);
            var resCreate = bo.Create(prodMod);

            Assert.IsTrue(!resCreate.Result);
        }
コード例 #3
0
        public void TestCreateAndReadProductModel()
        {
            ContextSeeder.Seed();
            var braBo = new BrandBusinessObject();
            var bra   = braBo.ListNotDeleted().Result.First();
            var catBo = new CategoryBusinessObject();
            var cat   = catBo.ListNotDeleted().Result.First();

            var bo        = new ProductModelBusinessObject();
            var prodMod   = new ProductModel("Vinho Branco", "506-1237-422", "", 4.24, 0.80, Measure.L, bra.Id, cat.Id);
            var resCreate = bo.Create(prodMod);

            var resGet = bo.Read(prodMod.Id);

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }