Ejemplo n.º 1
0
        public void Decode_ValidShareCode_ReturnsValidMatchId(string shareCode, ulong matchId, ulong outcomeId, uint token)
        {
            var gameRequest = ShareCodeDecoder.Decode(shareCode);

            Assert.Equal(matchId, gameRequest.MatchId);
            Assert.Equal(outcomeId, gameRequest.OutcomeId);
            Assert.Equal(token, gameRequest.Token);
        }
Ejemplo n.º 2
0
        public void TestDecoder()
        {
            var decoder = new ShareCodeDecoder("CSGO-727c4-5oCG3-PurVX-sJkdn-LsXfE");

            if (decoder.Decode().MatchID == 3208347562318757960)
            {
                Assert.True(true, "The decoded Match ID is 3208347562318757960");
            }
            else
            {
                Assert.True(false);
            }
        }
Ejemplo n.º 3
0
        public void GetMatchInfo_ShareCodeInput_ReturnsCorrectDateAndDownloadURL()
        {
            var gameCoordinatorClient = new GameCoordinatorClient();

            gameCoordinatorClient.ConnectAndLogin();
            var gameRequest = ShareCodeDecoder.Decode("CSGO-j6hrT-hvqmd-pNMXY-TuTrq-aXnMC");
            var demo        = new Demo {
                GameRequest = gameRequest
            };

            var match = gameCoordinatorClient.GetMatchInfo(demo);

            var expectedMatchDate   = new System.DateTime(637451358060000000);
            var expectedDownloadURL = @"http://replay191.valve.net/730/003456465718474703287_0558788749.dem.bz2";

            Assert.Equal(expectedMatchDate, match.Date);
            Assert.Equal(expectedDownloadURL, match.Demo.DownloadURL);
            Assert.Equal(13, match.TScore);
            Assert.Equal(16, match.CTScore);
            Assert.Equal(29, match.Rounds);
        }