示例#1
0
        public void SendIntel_Throws_ArgumentException_if_IntdelDataImage_IsNull()
        {
            IntelData data = new IntelData()
            {
                Agent = "agent", Image = null
            };

            target.SendIntel(data);
        }
示例#2
0
        public void SendIntel_Throws_ArgumentException_if_IntdelDataAgent_IsEmpty()
        {
            IntelData data = new IntelData()
            {
                Agent = string.Empty
            };

            target.SendIntel(data);
        }
示例#3
0
        private void SendIntel()
        {
            IntelData data = new IntelData();

            data.Agent   = this.Agent;
            data.Caption = this.Caption;
            data.Image   = this.RawImage;

            _intelClient.SendIntel(data);
        }
示例#4
0
        public void IntelDataConstructorTest()
        {
            string    agent   = "agent";
            Bitmap    image   = new Bitmap(100, 100);
            string    caption = "caption";
            IntelData target  = new IntelData(agent, image, caption);

            Assert.AreEqual <string>(agent, target.Agent);
            Assert.AreEqual <Bitmap>(image, target.Image);
            Assert.AreEqual <string>(caption, target.Caption);
        }
示例#5
0
        public void SendItel_Fires_IntelReceivedEvent()
        {
            string agent   = "agent";
            string caption = "caption";
            Bitmap image   = new Bitmap(100, 100);

            bool result = false;

            _target.IntelReceived += new System.EventHandler <IntelEventArgs>((o, e) => { result = true; });
            IntelData data = new IntelData(agent, image, caption);

            _target.SendIntel(data);
            Assert.IsTrue(result);
        }
示例#6
0
        public void SendIntel(IntelData intelData)
        {
            if (intelData == null)
            {
                throw new ArgumentException("IntelData cannot be null.");
            }

            if (intelData.Image == null)
            {
                throw new ArgumentException("IntelData.Image cannot be null.");
            }

            intelData.Agent = this.Agent;
            IntelServiceProxy.SendIntel(intelData);
        }
示例#7
0
        public void SendItel_IntelReceivedEvent_Returns_Correct_IntelEventArg()
        {
            string agent   = "agent";
            string caption = "caption";
            Bitmap image   = new Bitmap(100, 100);

            IntelEventArgs args = null;

            _target.IntelReceived += new System.EventHandler <IntelEventArgs>((o, e) => { args = e; });
            IntelData data = new IntelData(agent, image, caption);

            _target.SendIntel(data);

            Assert.AreEqual <string>(agent, args.AgentProfile.Agent);
            Assert.AreEqual <Bitmap>(image, args.Image);
            Assert.AreEqual <string>(caption, args.Caption);
            Assert.AreEqual <IntelEventType>(IntelEventType.IntelReceived, args.EventType);
        }
示例#8
0
        public void ClientIntelUpdate(List <EveIntelCharacterInfo> characters)
        {
            IntelData intelData = new IntelData();;

            foreach (EveIntelCharacterInfo character in characters)
            {
                var stored = intelData.IntelDataTable.FirstOrDefault(o => o.CharacterID == character.CharacterID);
                if (stored != null)
                {
                    stored.SolarsystemID   = character.SolarsystemID;
                    stored.SolarsystemTime = character.SolarsystemTime;
                    stored.ShipTypeID      = character.ShipTypeID;
                    stored.ShipTypeTime    = character.ShipTypeTime;
                    stored.Notes           = character.Notes;
                }
                else
                {
                    var row = new IntelData.IntelDataRow();
                    row.CharacterID     = character.CharacterID;
                    row.CharacterName   = character.CharacterName;
                    row.CharacterKos    = character.CharacterKos;
                    row.CorporationName = character.CorporationName;
                    row.CorporationKos  = character.CorporationKos;
                    row.AllianceName    = character.AllianceName;
                    row.AllianceKos     = character.AllianceKos;
                    row.SolarsystemID   = character.SolarsystemID;
                    row.SolarsystemTime = character.SolarsystemTime;
                    row.ShipTypeID      = character.ShipTypeID;
                    row.ShipTypeTime    = character.ShipTypeTime;
                    row.Notes           = character.Notes;
                    intelData.IntelDataTable.Add(row);
                }
            }
            intelData.SaveChanges();
            //mapControl1.UpdateData();
            intelGrid1.UpdateData();
        }