diff options
Diffstat (limited to 'linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs')
-rw-r--r-- | linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs index 2e0171a83..64b2f9ec9 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs @@ -5,19 +5,20 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions [AttributeUsage(AttributeTargets.Class | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false)] public class KeptTypeInAssemblyAttribute : BaseExpectedLinkedBehaviorAttribute { - public readonly string AssemblyFileName; - public readonly string TypeName; - public KeptTypeInAssemblyAttribute (string assemblyFileName, Type type) { - AssemblyFileName = assemblyFileName; - TypeName = type.ToString (); + if (type == null) + throw new ArgumentNullException (nameof (type)); + if (string.IsNullOrEmpty (assemblyFileName)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); } public KeptTypeInAssemblyAttribute (string assemblyFileName, string typeName) { - AssemblyFileName = assemblyFileName; - TypeName = typeName; + if (string.IsNullOrEmpty (assemblyFileName)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); + if (string.IsNullOrEmpty (typeName)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (typeName)); } } } |