OSDN Git Service

Merge pull request #307 from opentween/detect-rate-limits
[opentween/open-tween.git] / OpenTween.Tests / BingTest.cs
1 // OpenTween - Client of Twitter
2 // Copyright (c) 2012 the40san <http://sourceforge.jp/users/the40san/>
3 //           (c) 2014 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
4 // All rights reserved.
5 //
6 // This file is part of OpenTween.
7 //
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General public License as published by the Free
10 // Software Foundation; either version 3 of the License, or (at your option)
11 // any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General public License
16 // for more details.
17 //
18 // You should have received a copy of the GNU General public License along
19 // with this program. If not, see <http://www.gnu.org/licenses/>, or write to
20 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
21 // Boston, MA 02110-1301, USA.
22
23 using System;
24 using System.Net;
25 using System.Net.Http;
26 using System.Text;
27 using System.Threading.Tasks;
28 using System.Web;
29 using Xunit;
30 using Xunit.Extensions;
31
32 namespace OpenTween
33 {
34     /// <summary>
35     /// Bingクラスのテストクラス
36     /// </summary>
37     public class BingTest
38     {
39         [Fact]
40         public void Initialize_Test()
41             => new Bing();
42
43         [Theory]
44         [InlineData("af", 0)]
45         [InlineData("sq", 1)]
46         [InlineData("ja", 67)]
47         public void GetLanguageEnumFromIndex_Test(string expected, int index)
48             => Assert.Equal(expected, Bing.GetLanguageEnumFromIndex(index));
49
50         [Theory]
51         [InlineData(0, "af")]
52         [InlineData(1, "sq")]
53         [InlineData(67, "ja")]
54         public void GetIndexFromLanguageEnum_Test(int expected, string lang)
55             => Assert.Equal(expected, Bing.GetIndexFromLanguageEnum(lang));
56     }
57 }