コード例 #1
0
        public async Task GetNonexistantHash()
        {
            SongInfoManager  manager  = GetDefaultManager();
            string           hash     = "9d11a002f1d2b6b08dce90a32dab62b8ed";
            SongInfoResponse response = await manager.GetSongByHashAsync(hash).ConfigureAwait(false);

            Assert.IsFalse(response.Success);
            Assert.IsNull(response.Song);
            Assert.AreEqual(2, response.GetFailedResponses().Length);
        }
コード例 #2
0
        public async Task GetNonexistantKey()
        {
            SongInfoManager  manager  = GetDefaultManager();
            string           key      = "9d11a8ed";
            SongInfoResponse response = await manager.GetSongByKeyAsync(key).ConfigureAwait(false);

            Assert.IsFalse(response.Success);
            Assert.IsNull(response.Song);
            Assert.AreEqual(2, response.GetFailedResponses().Length);
        }
コード例 #3
0
        public async Task GetByHashNotInMock()
        {
            SongInfoManager  manager  = GetDefaultManager();
            string           hash     = "9d11a002f1d2b6b08dce90a3e2b4a62dab62b8ed";
            SongInfoResponse response = await manager.GetSongByHashAsync(hash).ConfigureAwait(false);

            Assert.IsTrue(response.Success);
            Assert.IsTrue(response.Source is BeatSaverSongInfoProvider);
            Assert.IsNotNull(response.Song);
            Assert.AreEqual(1, response.GetFailedResponses().Length);
        }
コード例 #4
0
        public async Task GetByHashFromMock()
        {
            SongInfoManager  manager  = GetDefaultManager();
            string           hash     = "e2512e6fbf85059d9fd9b429f62b2e618dd4d7e9";
            SongInfoResponse response = await manager.GetSongByHashAsync(hash).ConfigureAwait(false);

            Assert.IsTrue(response.Success);
            Assert.IsTrue(response.Source is MockInfoProvider);
            Assert.IsNotNull(response.Song);
            Assert.AreEqual(0, response.GetFailedResponses().Length);
        }
コード例 #5
0
        public async Task GetByKeyNotInMock()
        {
            SongInfoManager  manager  = GetDefaultManager();
            string           key      = "b";
            SongInfoResponse response = await manager.GetSongByKeyAsync(key).ConfigureAwait(false);

            Assert.IsTrue(response.Success);
            Assert.IsTrue(response.Source is BeatSaverSongInfoProvider);
            Assert.IsNotNull(response.Song);
            Assert.AreEqual(1, response.GetFailedResponses().Length);
        }