예제 #1
0
        public void GetProductInfoNoPremmision()
        {
            userService.SignIn("Big Smoke", "123");
            StoreManagementService service = (StoreManagementService)market.GetStoreManagementService(userService, "X");
            MarketAnswer           ans     = service.GetProductInfo("name0");

            Assert.AreEqual((int)ViewProductInfoStatus.NoAuthority, ans.Status);
        }
예제 #2
0
        public void ProductInfoProductNotAvailable()
        {
            userService.SignIn("Arik1", "123");
            StoreManagementService service = (StoreManagementService)market.GetStoreManagementService(userService, "X");
            MarketAnswer           ans     = service.GetProductInfo("name0");

            Assert.AreEqual((int)StoreEnum.ProductNotFound, ans.Status);
        }
예제 #3
0
        public void GetProductInfoStoreNotExists()
        {
            userService.SignIn("Arik1", "123");
            StoreManagementService service = (StoreManagementService)market.GetStoreManagementService(userService, "storeNotExists");
            MarketAnswer           ans     = service.GetProductInfo("name0");

            Assert.AreEqual((int)StoreEnum.StoreNotExists, ans.Status);
        }
예제 #4
0
        public void GetProductInfoSuccess()
        {
            userService.SignIn("Arik1", "123");
            StoreManagementService service = (StoreManagementService)market.GetStoreManagementService(userService, "X");

            service.AddNewProduct("GOLD", 5, "NONO", 8);
            MarketAnswer ans = service.GetProductInfo("GOLD");

            Assert.AreEqual((int)ViewProductInfoStatus.Success, ans.Status);
            string expected = " name: GOLD base price: 5 description: NONO";

            Assert.AreEqual(expected, ans.ReportList[0]);
        }