public async Task AttributeAsync_successfully_returns_a_V1DogmaAttribute() { LatestDogmaEndpoints internalLatestDogma = new LatestDogmaEndpoints(string.Empty, true); V1DogmaAttribute result = await internalLatestDogma.AttributeAsync(0); Assert.Equal(20, result.AttributeId); Assert.Equal(1, result.DefaultValue); Assert.Equal("Factor by which topspeed increases.", result.Description); Assert.Equal("Maximum Velocity Bonus", result.DisplayName); Assert.True(result.HighIsGood); Assert.Equal(1389, result.IconId); Assert.Equal("speedFactor", result.Name); Assert.True(result.Published); Assert.Equal(124, result.UnitId); }
public async Task AttributeAsync_successfully_returns_a_V1DogmaAttribute() { Mock <IWebClient> mockedWebClient = new Mock <IWebClient>(); string json = "{\r\n \"attribute_id\": 20,\r\n \"default_value\": 1,\r\n \"description\": \"Factor by which topspeed increases.\",\r\n \"display_name\": \"Maximum Velocity Bonus\",\r\n \"high_is_good\": true,\r\n \"icon_id\": 1389,\r\n \"name\": \"speedFactor\",\r\n \"published\": true,\r\n \"unit_id\": 124\r\n}"; mockedWebClient.Setup(x => x.GetAsync(It.IsAny <WebHeaderCollection>(), It.IsAny <string>(), It.IsAny <int>())).ReturnsAsync(new EsiModel { Model = json }); InternalLatestDogma internalLatestDogma = new InternalLatestDogma(mockedWebClient.Object, string.Empty); V1DogmaAttribute result = await internalLatestDogma.AttributeAsync(0); Assert.Equal(20, result.AttributeId); Assert.Equal(1, result.DefaultValue); Assert.Equal("Factor by which topspeed increases.", result.Description); Assert.Equal("Maximum Velocity Bonus", result.DisplayName); Assert.True(result.HighIsGood); Assert.Equal(1389, result.IconId); Assert.Equal("speedFactor", result.Name); Assert.True(result.Published); Assert.Equal(124, result.UnitId); }