Beispiel #1
0
        // testing http Get (GetAgreement)
        public void Test_ShouldNotReturnAgreement()
        {
            var db = new TestRatesDatabaseContext();

            Agreement agreement = TestData.GetTestAgreement1(TestData.GetTestCustomer(), TestData.GetTestBaseRate1().Code);

            db.Agreements.Add(agreement);

            Assert.AreEqual(1, db.Agreements.Local.Count);

            var ratesController = new RatesController(db);
            var httpResult      = ratesController.GetAgreement(agreement.Id++);

            Assert.IsTrue(httpResult is NotFoundResult);
        }
Beispiel #2
0
        // testing http Get (GetAgreement)
        public void Test_ShouldReturnAgreementByTheSameId()
        {
            var db = new TestRatesDatabaseContext();

            Agreement agreement = TestData.GetTestAgreement1(TestData.GetTestCustomer(), TestData.GetTestBaseRate1().Code);

            db.Agreements.Add(agreement);

            Assert.AreEqual(1, db.Agreements.Local.Count);

            var ratesController = new RatesController(db);
            var httpResult      = ratesController.GetAgreement(agreement.Id) as OkNegotiatedContentResult <Agreement>;

            Assert.IsNotNull(httpResult);
            Assert.AreEqual(agreement.Id, httpResult.Content.Id);
        }