public void GetTradeIdsTakesPlayersAndReturnsStringWithIds() { //Arrange var players = new List <BidViewModel> { new BidViewModel { TradeId = "12345", Status = "outbid" }, new BidViewModel { TradeId = "54321", Status = "outbid" }, new BidViewModel { TradeId = "9876", Status = "highest" } }; var expected = new TradeIdsModel { TradeIds = "12345,54321" }; //Act var actual = _tradeIdsBuilder.GetTradeIds(players); //Assert actual.Should().BeEquivalentTo(expected); }
public void DeleteExpiredPlayersCallsDeleteMakerAndDoesNotThrowError() { //Arrange var token = "Abc"; var players = new List <BidViewModel>(); var ids = new TradeIdsModel { TradeIds = "12345" }; A.CallTo(() => _tradeIdsBuilder.GetTradeIds(players)).Returns(ids); A.CallTo(() => _urlBuilder.BuildDeletePlayerUrl(ids.TradeIds)).Returns("DeleteUrl"); //Act //Assert Assert.DoesNotThrow(() => _deleteHandler.DeleteExpiredPlayers(token, players)); A.CallTo(() => _deleteMaker.MakeDeleteRequest(token, "DeleteUrl")).MustHaveHappenedOnceExactly(); }
public async Task DeleteExpiredPlayers(string accessToken, List <BidViewModel> players) { var tradeIds = _tradeIdsBuilder.GetTradeIds(players); var url = _urlBuilder.BuildDeletePlayerUrl(tradeIds.TradeIds); await _deleteMaker.MakeDeleteRequest(accessToken, url); }