Exemplo n.º 1
0
        public void CheckDisconnectedRegex_DisconnectedMessageFromLogAsInput_ExpectedCorrectConstructionOfObject()
        {
            string input = "\"WeedMonkey<77><STEAM_1:1:84194999><>\" disconnected (reason \"Disconnect\")";

            var             regex           = new DisconnectedRegex();
            AbstractMessage abstractMessage = regex.Parse(input);

            Assert.NotNull(abstractMessage);
            var disconnectedMessage = (DisconnectedMessage)abstractMessage;

            Assert.Equal("WeedMonkey", disconnectedMessage.UserName);
            Assert.Equal("77", disconnectedMessage.UserID);
            Assert.Equal("STEAM_1:1:84194999", disconnectedMessage.UserSteamID);
            Assert.Equal("", disconnectedMessage.UserTeam);
            Assert.Equal("Disconnect", disconnectedMessage.Reason);
        }
Exemplo n.º 2
0
        public void CheckDisconnectedRegex_DisconnectedMessageAsInput_ExpectedCorrectConstructionOfObject()
        {
            string input = "\"Hu3bl<2><STEAM_1:1:10481859><CT>\" disconnected (reason \"Disconnect\")";

            var             regex           = new DisconnectedRegex();
            AbstractMessage abstractMessage = regex.Parse(input);

            Assert.NotNull(abstractMessage);
            var disconnectedMessage = (DisconnectedMessage)abstractMessage;

            Assert.Equal("Hu3bl", disconnectedMessage.UserName);
            Assert.Equal("2", disconnectedMessage.UserID);
            Assert.Equal("STEAM_1:1:10481859", disconnectedMessage.UserSteamID);
            Assert.Equal("CT", disconnectedMessage.UserTeam);
            Assert.Equal("Disconnect", disconnectedMessage.Reason);
        }