public void TryParseTypeAssemblyQualifiedName_GenericType_NameAndAssemblyOnly() { var value = $"{typeof (SampleGenericType<,>).FullName}, {typeof (TypeNameParserTests).Assembly.GetName ().Name}"; Assert.That(TypeNameParser.TryParseTypeAssemblyQualifiedName(value, out string typeName, out string assemblyName), Is.True); Assert.That(typeName, Is.EqualTo($"{typeof (TypeNameParserTests).FullName}/SampleGenericType`2")); Assert.That(assemblyName, Is.EqualTo(typeof(TypeNameParserTests).Assembly.GetName().Name)); }
public void TryParseTypeAssemblyQualifiedName_NestedType_NameOnly() { var value = typeof(SampleNestedType).FullName; Assert.That(TypeNameParser.TryParseTypeAssemblyQualifiedName(value, out string typeName, out string assemblyName), Is.True); Assert.That(typeName, Is.EqualTo($"{typeof (TypeNameParserTests).FullName}/{nameof (SampleNestedType)}")); Assert.That(assemblyName, Is.Null); }
public void TryParseTypeAssemblyQualifiedName_FullyQualified() { var value = typeof(TypeNameParserTests).AssemblyQualifiedName; Assert.That(TypeNameParser.TryParseTypeAssemblyQualifiedName(value, out string typeName, out string assemblyName), Is.True); Assert.That(typeName, Is.EqualTo(typeof(TypeNameParserTests).FullName)); Assert.That(assemblyName, Is.EqualTo(typeof(TypeNameParserTests).Assembly.GetName().Name)); }
public void TryParseTypeAssemblyQualifiedName_Null() { Assert.That(TypeNameParser.TryParseTypeAssemblyQualifiedName(null, out string typeName, out string assemblyName), Is.False); }
public void InvalidValues(string name) { Assert.That(TypeNameParser.TryParseTypeAssemblyQualifiedName(name, out string typeName, out string assemblyName), Is.False); Assert.That(typeName, Is.Null); Assert.That(assemblyName, Is.Null); }
public void MissingTypeName() { Assert.That(TypeNameParser.TryParseTypeAssemblyQualifiedName(", System", out string typeName, out string assemblyName), Is.False); Assert.That(typeName, Is.Null); Assert.That(assemblyName, Is.Null); }
public void TryParseTypeAssemblyQualifiedName_Null() { Assert.That(TypeNameParser.TryParseTypeAssemblyQualifiedName(null, out _, out _), Is.False); }