public void TestLeadDistribution_AddNewAgent()
 {
     LeadDTO newLead = new LeadDTO() { ID = 1, Interest = "Car Insurance", Name = "John Doe", Territory = "North" };
     ///Hire a new agent in North region
     service.AddAgent(new AgentDTO() { ID = 7, Name = "NAgent7", Territory = "North" });
     ///Send a lead in north region
     Assert.AreEqual("NAgent7", service.ProcessLead(newLead).Data.Name);
 }
        public void TestLeadDistribution_ProcessAllEastLeads()
        {
            LeadDTO newLead = new LeadDTO() { ID = 1, Interest = "Life Insurance", Name = "John Doe", Territory = "East" };
            Assert.AreEqual("EAgent5", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 2, Interest = "Life Insurance", Name = "John Doe", Territory = "East" };
            Assert.AreEqual("EAgent4", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 3, Interest = "Car Insurance", Name = "John Doe", Territory = "East" };
            Assert.AreEqual("EAgent3", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 4, Interest = "House Insurance", Name = "John Doe", Territory = "East" };
            Assert.AreEqual("EAgent2", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 5, Interest = "Travel Insurance", Name = "John Doe", Territory = "East" };
            Assert.AreEqual("EAgent1", service.ProcessLead(newLead).Data.Name);
        }
 public void TestLeadDistribution_ProcessInvalidRegionLead()
 {
     LeadDTO lead = new LeadDTO() { ID = 1, Interest = "Life Insurance", Name = "John Doe", Territory = "NorthWest" };
     Assert.AreEqual(OperationResultType.Failure, service.ProcessLead(lead).Result);
 }
 public void TestLeadDistribution_ProcessLeadWhenAllAgentHaveBeenScheduledOnce()
 {
     ///Schedule all agents for north region
     TestLeadDistribution_ProcessAllNorthLeads();
     ///Send a lead to  north region
     LeadDTO newLead = new LeadDTO() { ID = 7, Interest = "Life Insurance", Name = "John Doe", Territory = "North" };
     Assert.AreEqual("NAgent6", service.ProcessLead(newLead).Data.Name);
 }
        public void TestLeadDistribution_ProcessAllNorthLeads()
        {
            LeadDTO newLead = new LeadDTO() { ID = 1, Interest = "Health Insurance", Name = "John Doe", Territory = "North" };
            Assert.AreEqual("NAgent6", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 2, Interest = "Gold Insurance", Name = "John Doe", Territory = "North" };
            Assert.AreEqual("NAgent5", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 3, Interest = "Wealth Insurance", Name = "John Doe", Territory = "North" };
            Assert.AreEqual("NAgent4", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 4, Interest = "Car Insurance", Name = "John Doe", Territory = "North" };
            Assert.AreEqual("NAgent3", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 5, Interest = "Mobile Insurance", Name = "John Doe", Territory = "North" };
            Assert.AreEqual("NAgent2", service.ProcessLead(newLead).Data.Name);

            newLead = new LeadDTO() { ID = 6, Interest = "Health Insurance", Name = "John Doe", Territory = "North" };
            Assert.AreEqual("NAgent1", service.ProcessLead(newLead).Data.Name);
        }