public void approve_public_api() { var assembly = typeof(StringHumanizeExtensions).Assembly; var publicApi = PublicApiGenerator.CreatePublicApiForAssembly(assembly); Approvals.Verify(publicApi); }
public void ApproveCore() { var assemblyPath = Path.GetFullPath(typeof(PatternMatch).Assembly.Location); var asm = AssemblyDefinition.ReadAssembly(assemblyPath); var publicApi = Filter(PublicApiGenerator.CreatePublicApiForAssembly(asm)); Approvals.Verify(publicApi); }
public void ApproveClusterTools() { var assemblyPath = Path.GetFullPath(typeof(ClusterSingletonManager).Assembly.Location); var asm = AssemblyDefinition.ReadAssembly(assemblyPath); var publicApi = Filter(PublicApiGenerator.CreatePublicApiForAssembly(asm)); Approvals.Verify(publicApi); }
private static void AssertPublicApi(AssemblyDefinition assemblyDefinition, Type[] types, string expectedOutput, bool includeAssemblyAttributes) { var typesNames = new HashSet <string>(types.Select(t => t.FullName)); var actualOutput = PublicApiGenerator.CreatePublicApiForAssembly(assemblyDefinition, t => typesNames.Contains(t.FullName), includeAssemblyAttributes); actualOutput = StripEmptyLines.Replace(actualOutput, string.Empty); Assert.Equal(expectedOutput, actualOutput); }
public void Approve() { var assemblyPath = Path.GetFullPath(typeof(EndpointSLAAttribute).Assembly.Location); var asm = AssemblyDefinition.ReadAssembly(assemblyPath); var publicApi = Filter(PublicApiGenerator.CreatePublicApiForAssembly(asm)); Approvals.Verify(publicApi); }
public void Approve() { Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); var assemblyPath = Path.GetFullPath(typeof(AutofacBuilder).Assembly.Location); var asm = AssemblyDefinition.ReadAssembly(assemblyPath); var publicApi = Filter(PublicApiGenerator.CreatePublicApiForAssembly(asm)); Approvals.Verify(publicApi); }
public void ApproveAzureServiceBusTransport() { Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); var assemblyPath = Path.GetFullPath(typeof(AzureServiceBusTransport).Assembly.Location); var asm = AssemblyDefinition.ReadAssembly(assemblyPath); var publicApi = PublicApiGenerator.CreatePublicApiForAssembly(asm, definition => true, false); Approvals.Verify(publicApi); }
private static void ApproveApi(string frameworkVersion) { string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(new Uri(codeBase)); string assemblyPath = Uri.UnescapeDataString(uri.Path); var containingDirectory = Path.GetDirectoryName(assemblyPath); var configurationName = new DirectoryInfo(containingDirectory).Parent.Name; var assemblyFile = $@"..\..\..\..\..\src\FakeItEasy\bin\{configurationName}\{frameworkVersion}\FakeItEasy.dll"; var assembly = Assembly.LoadFile(Path.GetFullPath(assemblyFile)); Approvals.Verify(PublicApiGenerator.GetPublicApi(assembly)); }
public void ApproveApiNetStd() { // Approvals and PublicApiGenerator aren't available for .NET Core, so // we'll load the .NET Standard FakeItEasy assembly from disk and // examine it. string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(new Uri(codeBase)); string assemblyPath = Uri.UnescapeDataString(uri.Path); var containingDirectory = Path.GetDirectoryName(assemblyPath); var configurationName = new DirectoryInfo(containingDirectory).Name; var assemblyFile = @"..\..\..\..\src\FakeItEasy.netstd\bin\" + configurationName + @"\FakeItEasy.dll"; var assembly = Assembly.LoadFrom(assemblyFile); Approvals.Verify(PublicApiGenerator.GetPublicApi(assembly)); }
public void approve_public_api() { var assemblyPath = typeof(StringHumanizeExtensions).Assembly.Location; var assemblyResolver = new DefaultAssemblyResolver(); assemblyResolver.AddSearchDirectory(Path.GetDirectoryName(assemblyPath)); var readSymbols = File.Exists(Path.ChangeExtension(assemblyPath, ".pdb")); var asm = AssemblyDefinition.ReadAssembly(assemblyPath, new ReaderParameters(ReadingMode.Deferred) { ReadSymbols = readSymbols, AssemblyResolver = assemblyResolver }); var publicApi = PublicApiGenerator.CreatePublicApiForAssembly(asm); Approvals.Verify(publicApi); }
public void ApproveApi() { Approvals.Verify(PublicApiGenerator.GetPublicApi(typeof(A).Assembly)); }