예제 #1
0
        public void BillEnsureICanLogSupport()
        {
            Vote vote = new Vote();
            Bill bill = new Bill();
            bill.AddVote(vote);
            bill.AddVote(vote);

            Assert.AreEqual(1, bill.PublicPosition.Count);
        }
예제 #2
0
        public void IssueEnsureICanAddLegislation()
        {
            Bill bill = new Bill();
            bill.HouseID = "hr1234";
            Issue iss = new Issue();

            iss.AddLegislation(bill);
            iss.AddLegislation(bill);

            Assert.AreEqual(1, iss.Legislation.Count);
            Assert.AreEqual("hr1234", iss.Legislation[0].HouseID);
        }
예제 #3
0
 public void AddLegislation(Bill bill)
 {
     if (Legislation == null)
     {
         Legislation = new List<Bill> { bill };
     }
     else
     {
         for (int i = 0; i < Legislation.Count; i++)
         {
             var legis = Legislation[i];
             if ((legis.HouseID != bill.HouseID)
                 || (legis.SenateID != bill.SenateID))
             {
                 Legislation.Add(bill);
             }
         }
     }
 }
예제 #4
0
 public void BillEnsureICanCreateAnInstance()
 {
     Bill bill = new Bill();
     Assert.IsNotNull(bill);
 }
예제 #5
0
        public void RepoEnsureICanGetABillById()
        {
            ConnectMocks();

            //Arrange
            Bill bill = new Bill();
            bill.HouseID = "hr1234";
            bill.Name = "GUNS!";
            Bill bill_2 = new Bill();
            bill_2.SenateID = "sr5678";
            bill_2.Name = "MONEY!";
            bill_datasource.Add(bill);
            bill_datasource.Add(bill_2);

            //Act
            var thing1 = Repo.GetBill("hr1234");
            var thing2 = Repo.GetBill("sr5678");

            //Assert
            Assert.AreEqual("GUNS!", thing1.Name);
            Assert.AreEqual("MONEY!", thing2.Name);
        }
예제 #6
0
 public void AddBillByBill(Bill bill)
 {
     context.Bills.Add(bill);
     context.SaveChanges();
 }