Skip to content

Commit b4b8e07

Browse files
committed
Re-added public api approver test (woot!)
1 parent 6c96e1e commit b4b8e07

File tree

3 files changed

+14
-33
lines changed

3 files changed

+14
-33
lines changed

TestStack.Dossier.Tests/PublicApiApproval/PublicApiApproverTests.GivenDossierAssembly_WhenPublicApiChecked_ShouldHaveNoChanges.approved.txt

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("DynamicProxyGenAssembly2")]
2-
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("TestStack.Dossier.Tests")]
3-
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
4-
[assembly: System.Runtime.InteropServices.GuidAttribute("24a139fb-b390-4f14-9be6-cf9fb354bb5d")]
5-
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName=".NET Framework 4")]
6-
71
namespace TestStack.Dossier
82
{
9-
103
public class AddressAusEquivalence
114
{
125
public AddressAusEquivalence(TestStack.Dossier.AnonymousValueFixture fixture) { }
@@ -55,14 +48,14 @@ namespace TestStack.Dossier
5548
public TestStack.Dossier.CompanyEquivalence Company { get; }
5649
public static System.Collections.Generic.IEnumerable<TestStack.Dossier.IAnonymousValueSupplier> DefaultValueSuppliers { get; }
5750
public TestStack.Dossier.FinanceEquivalence Finance { get; }
58-
public Ploeh.AutoFixture.Fixture Fixture { get; }
51+
public AutoFixture.Fixture Fixture { get; }
5952
public TestStack.Dossier.GeoEquivalence Geography { get; }
6053
public static System.Collections.Generic.ICollection<TestStack.Dossier.IAnonymousValueSupplier> GlobalValueSuppliers { get; }
6154
public TestStack.Dossier.IdentifierEquivalence Identifier { get; }
6255
public TestStack.Dossier.InternetEquivalence Internet { get; }
6356
public System.Collections.Generic.ICollection<TestStack.Dossier.IAnonymousValueSupplier> LocalValueSuppliers { get; }
6457
public TestStack.Dossier.PersonEquivalence Person { get; }
65-
public Ploeh.AutoFixture.RegularExpressionGenerator RegexGenerator { get; }
58+
public AutoFixture.RegularExpressionGenerator RegexGenerator { get; }
6659
public T Get<TObject, T>(System.Linq.Expressions.Expression<System.Func<TObject, T>> property) { }
6760
public object Get(System.Type type, string propertyName) { }
6861
public TestStack.Dossier.DataSources.Dictionaries.Words Words(string dictionaryName) { }
@@ -200,15 +193,15 @@ namespace TestStack.Dossier
200193
protected bool Has<TValue>(System.Linq.Expressions.Expression<System.Func<TObject, TValue>> property) { }
201194
protected bool Has(string propertyName) { }
202195
public virtual bool IsListBuilderProxy() { }
196+
public static TObject op_Implicit(TestStack.Dossier.TestDataBuilder<TObject, TBuilder> builder) { }
197+
public static System.Collections.Generic.List<TObject> op_Implicit(TestStack.Dossier.TestDataBuilder<TObject, TBuilder> builder) { }
203198
public virtual TBuilder Set<TValue>(System.Linq.Expressions.Expression<System.Func<TObject, TValue>> property, TValue value) { }
204199
public virtual TBuilder Set<TValue>(System.Linq.Expressions.Expression<System.Func<TObject, TValue>> property, System.Func<TValue> factory) { }
205200
}
206201
}
207202
namespace TestStack.Dossier.DataSources
208203
{
209-
210204
public abstract class DataSource<T> : TestStack.Dossier.DataSources.IDataSource<T>
211-
212205
{
213206
protected DataSource(TestStack.Dossier.DataSources.Generators.IGenerator generator) { }
214207
protected DataSource() { }
@@ -218,7 +211,6 @@ namespace TestStack.Dossier.DataSources
218211
public virtual T Next() { }
219212
}
220213
public interface IDataSource<T>
221-
222214
{
223215
System.Collections.Generic.IList<T> Data { get; }
224216
TestStack.Dossier.DataSources.Generators.IGenerator Generator { get; }
@@ -227,7 +219,6 @@ namespace TestStack.Dossier.DataSources
227219
}
228220
namespace TestStack.Dossier.DataSources.Dictionaries
229221
{
230-
231222
[System.ObsoleteAttribute("FileDictionarySource is deprecated, please use Words(FromDictionary) instead.")]
232223
public abstract class FileDictionarySource : TestStack.Dossier.DataSources.DataSource<string>
233224
{
@@ -310,7 +301,6 @@ namespace TestStack.Dossier.DataSources.Dictionaries
310301
}
311302
namespace TestStack.Dossier.DataSources.Generators
312303
{
313-
314304
public interface IGenerator
315305
{
316306
int ListSize { get; set; }
@@ -337,7 +327,6 @@ namespace TestStack.Dossier.DataSources.Generators
337327
}
338328
namespace TestStack.Dossier.DataSources.Geography
339329
{
340-
341330
[System.ObsoleteAttribute("GeoContinentSource is deprecated, please use Words(FromDictionary.GeoContinent) i" +
342331
"nstead.")]
343332
public class GeoContinentSource : TestStack.Dossier.DataSources.Dictionaries.FileDictionarySource
@@ -371,7 +360,6 @@ namespace TestStack.Dossier.DataSources.Geography
371360
}
372361
namespace TestStack.Dossier.DataSources.Person
373362
{
374-
375363
[System.ObsoleteAttribute("PersonEmailAddressSource is deprecated, please use Words(FromDictionary.PersonEma" +
376364
"ilAddress) instead.")]
377365
public class PersonEmailAddressSource : TestStack.Dossier.DataSources.Dictionaries.FileDictionarySource
@@ -430,29 +418,25 @@ namespace TestStack.Dossier.DataSources.Person
430418
}
431419
namespace TestStack.Dossier.DataSources.Picking
432420
{
433-
434421
public class Pick
435422
{
436423
public Pick() { }
437424
public static TestStack.Dossier.DataSources.Picking.RandomItemSource<T> RandomItemFrom<T>(System.Collections.Generic.IList<T> list) { }
438425
public static TestStack.Dossier.DataSources.Picking.RepeatingSequenceSource<T> RepeatingSequenceFrom<T>(System.Collections.Generic.IList<T> list) { }
439426
}
440427
public class RandomItemSource<T> : TestStack.Dossier.DataSources.DataSource<T>
441-
442428
{
443429
public RandomItemSource(System.Collections.Generic.IList<T> list) { }
444430
protected override System.Collections.Generic.IList<T> InitializeDataSource() { }
445431
}
446432
public class RepeatingSequenceSource<T> : TestStack.Dossier.DataSources.DataSource<T>
447-
448433
{
449434
public RepeatingSequenceSource(System.Collections.Generic.IList<T> list) { }
450435
protected override System.Collections.Generic.IList<T> InitializeDataSource() { }
451436
}
452437
}
453438
namespace TestStack.Dossier.EquivalenceClasses
454439
{
455-
456440
public class static EnumEquivalenceClasses
457441
{
458442
public static TEnum Except<TEnum>(this TestStack.Dossier.AnonymousValueFixture fixture, params TEnum[] except)
@@ -477,7 +461,6 @@ namespace TestStack.Dossier.EquivalenceClasses
477461
}
478462
namespace TestStack.Dossier.EquivalenceClasses.Geo
479463
{
480-
481464
public class static GeographyEquivalenceClassescs
482465
{
483466
[System.ObsoleteAttribute("Continent is deprecated, please use Geography.Continent instead.")]
@@ -494,7 +477,6 @@ namespace TestStack.Dossier.EquivalenceClasses.Geo
494477
}
495478
namespace TestStack.Dossier.EquivalenceClasses.Person
496479
{
497-
498480
public class static PersonEquivalenceClasses
499481
{
500482
[System.ObsoleteAttribute("EmailAddress is deprecated, please use Person.EmailAddress instead.")]
@@ -521,7 +503,6 @@ namespace TestStack.Dossier.EquivalenceClasses.Person
521503
}
522504
namespace TestStack.Dossier.Factories
523505
{
524-
525506
public class AllPropertiesFactory : TestStack.Dossier.Factories.CallConstructorFactory
526507
{
527508
public AllPropertiesFactory() { }
@@ -559,14 +540,14 @@ namespace TestStack.Dossier.Factories
559540
}
560541
namespace TestStack.Dossier.Lists
561542
{
562-
563543
public class ListBuilder<TObject, TBuilder>
564544
where TObject : class
565545
where TBuilder : TestStack.Dossier.TestDataBuilder<, >, new ()
566546
{
567547
public TBuilder All() { }
568548
public System.Collections.Generic.IList<TObject> BuildList() { }
569549
public System.Collections.Generic.IEnumerable<TBuilder> GetBuilders() { }
550+
public static System.Collections.Generic.List<TObject> op_Implicit(TestStack.Dossier.Lists.ListBuilder<TObject, TBuilder> builder) { }
570551
public TBuilder TheFirst(int howMany) { }
571552
public TBuilder TheLast(int howMany) { }
572553
public TBuilder TheNext(int howMany) { }
@@ -600,7 +581,6 @@ namespace TestStack.Dossier.Lists
600581
}
601582
namespace TestStack.Dossier.Suppliers
602583
{
603-
604584
public class DefaultEmailValueSupplier : TestStack.Dossier.IAnonymousValueSupplier
605585
{
606586
public DefaultEmailValueSupplier() { }

TestStack.Dossier.Tests/PublicApiApproval/PublicApiApproverTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ namespace TestStack.Dossier.Tests.PublicApiApproval
55
{
66
public class PublicApiApproverTests
77
{
8-
//[Fact]
9-
//public void GivenDossierAssembly_WhenPublicApiChecked_ShouldHaveNoChanges()
10-
//{
11-
// ShouldlyConfiguration.DiffTools.KnownDoNotLaunchStrategies.TeamCity.ShouldNotLaunch();
12-
// var dossierAssembly = typeof (AnonymousValueFixture).Assembly;
13-
// var publicApi = PublicApiGenerator.PublicApiGenerator.GetPublicApi(dossierAssembly);
14-
// publicApi.ShouldMatchApproved();
15-
//}
8+
[Fact]
9+
public void GivenDossierAssembly_WhenPublicApiChecked_ShouldHaveNoChanges()
10+
{
11+
ShouldlyConfiguration.DiffTools.KnownDoNotLaunchStrategies.TeamCity.ShouldNotLaunch();
12+
var dossierAssembly = typeof(AnonymousValueFixture).Assembly;
13+
var publicApi = PublicApiGenerator.ApiGenerator.GeneratePublicApi(dossierAssembly, shouldIncludeAssemblyAttributes: false);
14+
publicApi.ShouldMatchApproved();
15+
}
1616
}
1717
}

TestStack.Dossier.Tests/TestStack.Dossier.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<PackageReference Include="Castle.Core" Version="4.3.1" />
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
1010
<PackageReference Include="NSubstitute" Version="3.1.0" />
11+
<PackageReference Include="publicapigenerator" Version="8.1.0" />
1112
<PackageReference Include="Shouldly" Version="3.0.2" />
1213
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
1314
<PackageReference Include="xunit" Version="2.4.1" />

0 commit comments

Comments
 (0)