Beispiel #1
0
 public void Enter(AgentProfile agent)
 {
     if (agent != null && !string.IsNullOrEmpty(agent.Agent))
     {
         OnAgentStatusChanged(new IntelEventArgs(agent));
     }
 }
Beispiel #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;
            
        }
Beispiel #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;
        }
Beispiel #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;
        }
 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);
 }
 public void AgentProfileConstructorTest_With_Agent_Only() {
     string agent = "agent"; 
     AgentProfile target = new AgentProfile(agent);
     Assert.AreEqual<string>(agent, target.Agent);
 }
Beispiel #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);
 }
 public void Throw_Exception_With_EmpyAgent_In_AgentProfile()
 {
     AgentProfile profile = new AgentProfile(string.Empty);
     AgentViewModel target = new AgentViewModel(profile);
 }
 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);
 }
 public void IsOnline_Can_Be_Set()
 {
     AgentProfile agentProfile = new AgentProfile("agent");
     AgentViewModel target = new AgentViewModel(agentProfile);
     target.IsOnline = true;
     Assert.IsTrue(target.IsOnline);
 }