OSDN Git Service

式形式のメソッドを使用する (IDE0021, IDE0022, IDE0025, IDE0053)
[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         [Theory]
40         [InlineData("af", 0)]
41         [InlineData("sq", 1)]
42         [InlineData("ja", 67)]
43         public void GetLanguageEnumFromIndex_Test(string expected, int index)
44             => Assert.Equal(expected, Bing.GetLanguageEnumFromIndex(index));
45
46         [Theory]
47         [InlineData(0, "af")]
48         [InlineData(1, "sq")]
49         [InlineData(67, "ja")]
50         public void GetIndexFromLanguageEnum_Test(int expected, string lang)
51             => Assert.Equal(expected, Bing.GetIndexFromLanguageEnum(lang));
52     }
53 }