Example #1
0
 public void Enter(AgentProfile agent)
 {
     if (agent != null && !string.IsNullOrEmpty(agent.Agent))
     {
         OnAgentStatusChanged(new IntelEventArgs(agent));
     }
 }
Example #2
0
        public IntelEventArgs(AgentProfile agentProfile) {

            if (string.IsNullOrEmpty(agentProfile.Agent))
                throw new ArgumentException("Cannot be null or empty", "agent");

            this.AgentProfile = agentProfile;
            this.EventType = IntelEventType.AgentEnter;
            
        }
Example #3
0
        public AgentViewModel(AgentProfile agentProfile)
        {
            if (agentProfile == null)
                throw new ArgumentException("Cannot have null AgentProfile");

            if (string.IsNullOrEmpty(agentProfile.Agent))
                throw new ArgumentException("AgentProfile cannot have null or empty Agent string");

            _agentProfile = agentProfile;
        }
Example #4
0
        public IntelEventArgs(AgentProfile agentProfile)
        {
            if (string.IsNullOrEmpty(agentProfile.Agent))
            {
                throw new ArgumentException("Cannot be null or empty", "agent");
            }

            this.AgentProfile = agentProfile;
            this.EventType    = IntelEventType.AgentEnter;
        }
Example #5
0
 public void AgentProfileConstructorTest_With_AgentAndImage() {
     string agent = "agent";
     Bitmap image = new Bitmap(100, 100);
     AgentProfile target = new AgentProfile(agent,image);
     Assert.AreEqual<Bitmap>(image, target.Image);
 }
Example #6
0
 public void AgentProfileConstructorTest_With_Agent_Only() {
     string agent = "agent"; 
     AgentProfile target = new AgentProfile(agent);
     Assert.AreEqual<string>(agent, target.Agent);
 }
Example #7
0
 public void Enter(AgentProfile agent)
 {
     if (agent != null && !string.IsNullOrEmpty(agent.Agent) )
         OnAgentStatusChanged(new IntelEventArgs(agent));           
 }
 public void Image_IsNotNull_When_AgentProfileImage_IsNull()
 {
     AgentProfile agentProfile = new AgentProfile("agent");
     AgentViewModel target = new AgentViewModel(agentProfile);
     Assert.IsNotNull(target.Image);
 }
 public void IsOnline_IsFalse_At_Creation()
 {
     AgentProfile agentProfile = new AgentProfile("agent");
     AgentViewModel target = new AgentViewModel(agentProfile);
     Assert.IsFalse(target.IsOnline);
 }
Example #10
0
 public void Throw_Exception_With_EmpyAgent_In_AgentProfile()
 {
     AgentProfile profile = new AgentProfile(string.Empty);
     AgentViewModel target = new AgentViewModel(profile);
 }
Example #11
0
 public void PropertyChangedEvent_When_IsOnline_Updated()
 {
     bool result = false;
     AgentProfile agentProfile = new AgentProfile("agent");
     AgentViewModel target = new AgentViewModel(agentProfile);
     target.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler((o,e) => { if (e.PropertyName.Equals("IsOnline")) result = true; });
     target.IsOnline = true;
     Assert.IsTrue(result);
 }
Example #12
0
 public void IsOnline_Can_Be_Set()
 {
     AgentProfile agentProfile = new AgentProfile("agent");
     AgentViewModel target = new AgentViewModel(agentProfile);
     target.IsOnline = true;
     Assert.IsTrue(target.IsOnline);
 }