Пример #1
0
        public void DccDownloadTest()
        {
            var parser = new XG.Plugin.Irc.Parser.Types.Dcc.DownloadFromBot();
            EventArgs<Packet, Int64, IPAddress, int> raisedEvent = null;
            parser.OnAddDownload += (sender, e) => raisedEvent = e;

            raisedEvent = null;
            Parse(parser, "\u0001DCC SEND Testfile.with.a.long.name.mkv 1203194610 45000 975304559\u0001");

            Assert.AreEqual(0, raisedEvent.Value2);
            Assert.AreEqual("71.183.74.242", raisedEvent.Value3.ToString());
            Assert.AreEqual(45000, raisedEvent.Value4);
        }
        public void DccDownloadTest()
        {
            var parser = new XG.Plugin.Irc.Parser.Types.Dcc.DownloadFromBot();
            EventArgs <Packet, Int64, IPAddress, int> raisedEvent = null;

            parser.OnAddDownload += (sender, e) => raisedEvent = e;

            raisedEvent = null;
            Parse(parser, "\u0001DCC SEND Testfile.with.a.long.name.mkv 1203194610 45000 975304559\u0001");

            Assert.AreEqual(0, raisedEvent.Value2);
            Assert.AreEqual("71.183.74.242", raisedEvent.Value3.ToString());
            Assert.AreEqual(45000, raisedEvent.Value4);
        }