|
1 |
| -using StaticAnalysis.ProblemIds; |
| 1 | +using StaticAnalysis.BreakingChangeAnalyzer; |
| 2 | +using StaticAnalysis.ProblemIds; |
2 | 3 | using System;
|
| 4 | +using System.Collections; |
3 | 5 | using System.Collections.Generic;
|
4 | 6 | using System.IO;
|
5 | 7 | using System.Linq;
|
@@ -856,5 +858,53 @@ public void ChangeValidateRangeMaximum()
|
856 | 858 | .Where<int>((problemId) => problemId.Equals(BreakingChangeProblemId.ChangedValidateRangeMaximum))
|
857 | 859 | .SingleOrDefault<int>().Equals(BreakingChangeProblemId.ChangedValidateRangeMaximum));
|
858 | 860 | }
|
| 861 | + |
| 862 | + [Fact] |
| 863 | + [Trait(Category.AcceptanceType, Category.CheckIn)] |
| 864 | + public void CheckDifferentPublicKeyToken() |
| 865 | + { |
| 866 | + TypeMetadata unsignedType = new TypeMetadata() |
| 867 | + { |
| 868 | + AssemblyQualifiedName = "StaticAnalysis.Test.BreakingChangeAnalyzerTests, StaticAnalysis.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" |
| 869 | + }; |
| 870 | + TypeMetadata signedType = new TypeMetadata() |
| 871 | + { |
| 872 | + AssemblyQualifiedName = "StaticAnalysis.Test.BreakingChangeAnalyzerTests, StaticAnalysis.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=h1ccnwzjxvldu787" |
| 873 | + }; |
| 874 | + |
| 875 | + OutputMetadata unsignedOutputType = new OutputMetadata() |
| 876 | + { |
| 877 | + Type = unsignedType |
| 878 | + }; |
| 879 | + OutputMetadata signedOutputType = new OutputMetadata() |
| 880 | + { |
| 881 | + Type = signedType |
| 882 | + }; |
| 883 | + |
| 884 | + CmdletBreakingChangeMetadata unsignedCmdlet = new CmdletBreakingChangeMetadata() |
| 885 | + { |
| 886 | + VerbName = "Check", |
| 887 | + NounName = "DifferentPublicKeyToken", |
| 888 | + DefaultParameterSetName = "DefaultParameterSetName" |
| 889 | + }; |
| 890 | + CmdletBreakingChangeMetadata signedCmdlet = new CmdletBreakingChangeMetadata() |
| 891 | + { |
| 892 | + VerbName = "Check", |
| 893 | + NounName = "DifferentPublicKeyToken", |
| 894 | + DefaultParameterSetName = "DefaultParameterSetName" |
| 895 | + }; |
| 896 | + |
| 897 | + unsignedCmdlet.OutputTypes.Add(unsignedOutputType); |
| 898 | + signedCmdlet.OutputTypes.Add(signedOutputType); |
| 899 | + |
| 900 | + var issueLogger = analysisLogger.CreateLogger<BreakingChangeIssue>("BreakingChangeIssues.csv"); |
| 901 | + |
| 902 | + CmdletMetadataHelper helper = new CmdletMetadataHelper(); |
| 903 | + helper.CompareCmdletMetadata(new List<CmdletBreakingChangeMetadata> { unsignedCmdlet }, |
| 904 | + new List<CmdletBreakingChangeMetadata> { signedCmdlet }, |
| 905 | + issueLogger); |
| 906 | + |
| 907 | + Assert.Equal(0, issueLogger.Records.Count); |
| 908 | + } |
859 | 909 | }
|
860 | 910 | }
|
0 commit comments