|
1 | | -using NUnit.Framework; |
| 1 | +using Xunit; |
2 | 2 | using System.Linq; |
3 | 3 | using System; |
4 | 4 | using System.Threading.Tasks; |
5 | 5 |
|
6 | 6 | namespace MavenNet.Tests |
7 | 7 | { |
8 | | - [TestFixture()] |
9 | 8 | public class Test |
10 | 9 | { |
11 | 10 | const string GPS_LOCAL_REPO = "/Users/redth/Library/Developer/Xamarin/android-sdk-macosx/extras/google/m2repository/"; |
12 | 11 | const string ANDROID_THINGS_URL_REPO = "https://google.bintray.com/androidthings"; |
13 | 12 | const string GOOGLE_MAVEN_REPO = "https://dl.google.com/dl/android/maven2/"; |
14 | 13 |
|
15 | | - [Test()] |
| 14 | + [Fact] |
16 | 15 | public async Task Test_Refresh_URL() |
17 | 16 | { |
18 | 17 | var repo = MavenRepository.FromUrl(ANDROID_THINGS_URL_REPO); |
19 | 18 | await repo.Refresh(); |
20 | 19 |
|
21 | | - Assert.IsTrue(repo.Groups.Any()); |
| 20 | + Assert.True(repo.Groups.Any()); |
22 | 21 | } |
23 | 22 |
|
24 | | - [Test] |
| 23 | + [Fact] |
25 | 24 | public async Task Test_Project_URL() |
26 | 25 | { |
27 | 26 | var repo = MavenRepository.FromUrl(ANDROID_THINGS_URL_REPO); |
28 | 27 | await repo.Refresh(); |
29 | 28 |
|
30 | 29 | var project = await repo.GetProjectAsync("com.google.android.things", "androidthings", "0.2-devpreview"); |
31 | 30 |
|
32 | | - Assert.IsTrue(project != null); |
| 31 | + Assert.True(project != null); |
33 | 32 | } |
34 | 33 |
|
35 | | - [Test] |
| 34 | + [Fact] |
36 | 35 | public async Task Test_GroupIds_Project_URL() |
37 | 36 | { |
38 | 37 | var repo = MavenRepository.FromUrl(ANDROID_THINGS_URL_REPO); |
39 | 38 | await repo.Refresh("com.google.android.things"); |
40 | 39 |
|
41 | 40 | var project = await repo.GetProjectAsync("com.google.android.things", "androidthings", "0.2-devpreview"); |
42 | 41 |
|
43 | | - Assert.IsTrue(project != null); |
| 42 | + Assert.True(project != null); |
44 | 43 | } |
45 | 44 |
|
46 | | - [Category("LOCAL_ONLY")] |
47 | | - [Test] |
48 | | - public async Task Test_Refresh_FILE() |
49 | | - { |
50 | | - var repo = MavenRepository.FromDirectory(GPS_LOCAL_REPO); |
51 | | - await repo.Refresh(); |
| 45 | + //[Trait("Category", "LOCAL_ONLY")] |
| 46 | + //[Fact] |
| 47 | + //public async Task Test_Refresh_FILE() |
| 48 | + //{ |
| 49 | + // var repo = MavenRepository.FromDirectory(GPS_LOCAL_REPO); |
| 50 | + // await repo.Refresh(); |
52 | 51 |
|
53 | | - Assert.IsTrue(repo.Groups.Any()); |
54 | | - } |
| 52 | + // Assert.True(repo.Groups.Any()); |
| 53 | + //} |
55 | 54 |
|
56 | | - [Category("LOCAL_ONLY")] |
57 | | - [Test] |
58 | | - public async Task Test_Project_FILE() |
59 | | - { |
60 | | - var repo = MavenRepository.FromDirectory(GPS_LOCAL_REPO); |
61 | | - await repo.Refresh(); |
| 55 | + //[Trait("Category", "LOCAL_ONLY")] |
| 56 | + //[Fact] |
| 57 | + //public async Task Test_Project_FILE() |
| 58 | + //{ |
| 59 | + // var repo = MavenRepository.FromDirectory(GPS_LOCAL_REPO); |
| 60 | + // await repo.Refresh(); |
62 | 61 |
|
63 | | - var project = await repo.GetProjectAsync("com.google.android.gms", "play-services-basement", "10.2.0"); |
| 62 | + // var project = await repo.GetProjectAsync("com.google.android.gms", "play-services-basement", "10.2.0"); |
64 | 63 |
|
65 | | - Assert.IsTrue(project != null); |
| 64 | + // Assert.True(project != null); |
66 | 65 |
|
67 | | - Assert.IsTrue(project.Dependencies?.Any()); |
68 | | - } |
| 66 | + // Assert.True(project.Dependencies?.Any()); |
| 67 | + //} |
69 | 68 |
|
70 | | - [Category("LOCAL_ONLY")] |
71 | | - [Test] |
72 | | - public async Task Test_GroupIds_Project_FILE() |
73 | | - { |
74 | | - var repo = MavenRepository.FromDirectory(GPS_LOCAL_REPO); |
75 | | - await repo.Refresh("com.google.android.gms"); |
| 69 | + //[Trait("Category", "LOCAL_ONLY")] |
| 70 | + //[Fact] |
| 71 | + //public async Task Test_GroupIds_Project_FILE() |
| 72 | + //{ |
| 73 | + // var repo = MavenRepository.FromDirectory(GPS_LOCAL_REPO); |
| 74 | + // await repo.Refresh("com.google.android.gms"); |
76 | 75 |
|
77 | | - var project = await repo.GetProjectAsync("com.google.android.gms", "play-services-basement", "10.2.0"); |
| 76 | + // var project = await repo.GetProjectAsync("com.google.android.gms", "play-services-basement", "10.2.0"); |
78 | 77 |
|
79 | | - Assert.IsTrue(project != null); |
| 78 | + // Assert.True(project != null); |
80 | 79 |
|
81 | | - Assert.IsTrue(project.Dependencies?.Any()); |
82 | | - } |
| 80 | + // Assert.True(project.Dependencies?.Any()); |
| 81 | + //} |
83 | 82 |
|
84 | | - [Test] |
| 83 | + [Fact] |
85 | 84 | public async Task Test_Refresh_GOOGLE() |
86 | 85 | { |
87 | 86 | var repo = MavenRepository.FromGoogle(); |
88 | 87 | await repo.Refresh(); |
89 | 88 |
|
90 | | - Assert.IsTrue(repo.Groups.Any()); |
| 89 | + Assert.True(repo.Groups.Any()); |
91 | 90 | } |
92 | 91 |
|
93 | | - [Test] |
| 92 | + [Fact] |
94 | 93 | public async Task Test_Project_GOOGLE() |
95 | 94 | { |
96 | 95 | var repo = MavenRepository.FromGoogle(); |
97 | 96 | await repo.Refresh(); |
98 | 97 |
|
99 | 98 | var project = await repo.GetProjectAsync("com.google.android.gms", "play-services-basement", "10.2.0"); |
100 | 99 |
|
101 | | - Assert.IsTrue(project != null); |
| 100 | + Assert.True(project != null); |
102 | 101 |
|
103 | | - Assert.IsTrue(project.Dependencies?.Any()); |
| 102 | + Assert.True(project.Dependencies?.Any()); |
104 | 103 | } |
105 | 104 |
|
106 | | - [Test] |
| 105 | + [Fact] |
107 | 106 | public async Task Test_GroupIds_Project_GOOGLE() |
108 | 107 | { |
109 | 108 | var repo = MavenRepository.FromGoogle(); |
110 | 109 | await repo.Refresh("com.google.android.gms"); |
111 | 110 |
|
112 | 111 | var project = await repo.GetProjectAsync("com.google.android.gms", "play-services-basement", "10.2.0"); |
113 | 112 |
|
114 | | - Assert.IsTrue(project != null); |
| 113 | + Assert.True(project != null); |
115 | 114 |
|
116 | | - Assert.IsTrue(project.Dependencies?.Any()); |
| 115 | + Assert.True(project.Dependencies?.Any()); |
117 | 116 | } |
118 | 117 | } |
119 | 118 | } |
0 commit comments