Exemplo n.º 1
0
        public void AddLeadToLeadList()
        {
            Lead        lead1          = new Lead("Rusty", "Shackleford", "House", "Bunker", new System.DateTime(2018, 6, 10));
            List <Lead> expectedResult = new List <Lead>();

            leads.AddLead(lead1);
            expectedResult.Add(lead1);
            CollectionAssert.AreEqual(expectedResult, leads.GetLeads());
        }
Exemplo n.º 2
0
 public LeadsController()
 {
     leadList = new LeadList();
     string[] inputValues = { "Rusty Shackleford House Bunker 05/15/2018",
                              "Jim Harbaugh House Siding 07/19/2018",
                              "Dante Hicks Trailer Plumbing 05/27/2018",
                              "Phillip Fry Condo Plumbing 10/21/2018",
                              "Homer Simpson House Foundation 06/01/2018" };
     foreach (string line in inputValues)
     {
         leadList.AddLead(line);
     }
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            LeadList leads = new LeadList();

            try
            {
                foreach (string line in File.ReadLines(args[0]))
                {
                    leads.AddLead(line);
                }

                Console.WriteLine("");
                Console.WriteLine("Sorted by Property Type Then Project:");
                foreach (Lead l in leads.SortByPropertyTypeThenProject())
                {
                    Console.WriteLine(l.StringToPrint());
                }
                Console.WriteLine("");
                Console.WriteLine("Sorted by Start Date:");
                foreach (Lead l in leads.SortByStartDate())
                {
                    Console.WriteLine(l.StringToPrint());
                }
                Console.WriteLine("");
                Console.WriteLine("Sorted by Last Name Descending:");
                foreach (Lead l in leads.SortByLastNameDescending())
                {
                    Console.WriteLine(l.StringToPrint());
                }

                Console.ReadLine();
            }
            catch
            {
                Console.WriteLine("Please Specify the file in the command line");
            }
        }
Exemplo n.º 4
0
 public void Post([FromBody] string value)
 {
     leadList.AddLead(value);
 }