コード例 #1
0
ファイル: Test.cs プロジェクト: janiarrow/PlexureAPITest
        public void TEST_003_Purchase_Product()
        {
            int productId        = 1;
            var purchaseResponse = service.Purchase(productId);

            purchaseResponse.Expect(HttpStatusCode.Accepted);
        }
コード例 #2
0
ファイル: Test.cs プロジェクト: nanw94/APITest
        public void TEST_003_Purchase_Invalid_Product()
        {
            int productId = 9999999;
            var response  = service.Purchase(productId);

            response.Expect(HttpStatusCode.BadRequest);
        }
コード例 #3
0
ファイル: Test.cs プロジェクト: gurvinder13389/Plexure
        public void TEST_001_1_Purchase_Product_Message_PointCheck()
        {
            int productId = 1;
            var response  = service.Purchase(productId);

            response.Expect(HttpStatusCode.Accepted);
            response.ExpectPurchaseMessage("Purchase completed.");
            response.ExpectPurchasePoints(100);
        }
コード例 #4
0
        public void TEST_006_Purchase_Product()
        {
            int productId = 1;
            var response  = service.Purchase(productId);

            response.Expect(HttpStatusCode.Accepted);
            Assert.AreEqual("Purchase completed.", response.Entity.Message);
            Assert.AreEqual(100, response.Entity.Points);
        }
コード例 #5
0
        public void TEST_003_Purchase_Product()
        {
            //Arrange
            int productId = 1;

            //Act
            var purchaseResponse = _service.Purchase(productId);

            //Assert
            purchaseResponse.Expect(HttpStatusCode.Accepted,
                                    "Fail to purchase the product with id : " + productId);
        }
コード例 #6
0
        public void TEST_001PurchaseWithValidProductId()
        {
            int productId = 1;
            //Act
            var    response = service.Purchase(productId);
            string message  = response.Entity.Message;
            int    points   = response.Entity.Points;

            //Assert that points earned are 100
            Assert.AreEqual(100, points);
            response.Expect(HttpStatusCode.Accepted);
        }
コード例 #7
0
        public void TEST_003_Purchase_Product()
        {
            int productId   = 1;
            var purchaseRes = service.Purchase(productId);

            purchaseRes.Expect(HttpStatusCode.Accepted);

            // Response Output in console
            Console.WriteLine(purchaseRes.Entity.Message);
            Console.WriteLine("Awarded points: " + purchaseRes.Entity.Points);

            //Assert statements
            Assert.That(purchaseRes.Entity.Message, Is.EqualTo("Purchase completed."), "Purchase Did Not Complete.");
            Assert.That(purchaseRes.Entity.Points, Is.EqualTo(100), "Unknown Points Awarded");
        }
コード例 #8
0
        public void TEST_002_Purchase_Product()
        {
            int productId = 1;
            var purchaseP = service.Purchase(productId);

            TestContext.WriteLine("StatusCode is : " + (int)purchaseP.StatusCode);
        }
コード例 #9
0
        public void TEST_004_Purchase_Product(int productId, HttpStatusCode httpStatusCode)
        {
            var response = service.Purchase(productId);

            response.Expect(httpStatusCode);
        }