// testing http Get (GetAllAgreements) public void Test_ShouldReturnEmptyAgreementsList() { var db = new TestRatesDatabaseContext(); var ratesController = new RatesController(db); var result = ratesController.GetAllAgreements() as TestDbSet <Agreement>; Assert.IsNotNull(result); Assert.AreEqual(0, result.Local.Count); }
// testing http Get (GetAllAgreements) public void Test_ShouldReturnNotEmptyAgreementsList() { var db = new TestRatesDatabaseContext(); var agreement1 = TestData.GetTestAgreement1(TestData.GetTestCustomer(), TestData.GetTestBaseRate1().Code); var agreement2 = TestData.GetTestAgreement2(TestData.GetTestCustomer(), TestData.GetTestBaseRate2().Code); db.Agreements.Add(agreement1); db.Agreements.Add(agreement2); var ratesController = new RatesController(db); var result = ratesController.GetAllAgreements() as TestDbSet <Agreement>; Assert.IsNotNull(result); Assert.AreEqual(2, result.Local.Count); }