예제 #1
0
        [TestMethod] public void CreateTest()
        {
            var r = GetRandom.Object <GoodsData>();
            var o = new Good(r);
            var v = GoodViewFactory.Create(o);

            Assert.AreEqual(v.Name, o.Data.Name);
            Assert.AreEqual(v.ValidFrom, o.Data.ValidFrom);
            Assert.AreEqual(v.ValidTo, o.Data.ValidTo);
            Assert.AreEqual(v.ID, o.Data.ID);
            Assert.AreEqual(v.Price, o.Data.Price);
            Assert.AreEqual(v.ImgData, o.Data.ImgData);
            Assert.AreEqual(v.ImgName, o.Data.ImgName);
            Assert.AreEqual(v.Type, o.Data.Type);
            Assert.AreEqual(v.Description, o.Data.Description);
            Assert.AreEqual(v.Code, o.Data.Code);
        }
예제 #2
0
        public async Task <IActionResult> Edit(string id)
        {
            var c = await repository.GetObject(id);

            return(View(GoodViewFactory.Create(c)));
        }