public void GetTypeDisplayName_NoResourceFound_ReturnsShortTypeName() { _serviceStub .Stub( _ => _.TryGetTypeDisplayName( Arg.Is(_typeInformationStub), Arg.Is(_typeInformationForResourceResolutionStub), out Arg <string> .Out(null).Dummy)) .Return(false); var result = _serviceStub.GetTypeDisplayName(_typeInformationStub, _typeInformationForResourceResolutionStub); Assert.That(result, Is.EqualTo("TypeName")); }
/// <summary> /// Gets the localized display name of a type. /// </summary> /// <param name="typeInformation">The <see cref="ITypeInformation"/> for which to lookup the resource.</param> /// <param name="typeInformationForResourceResolution">The <see cref="ITypeInformation"/> providing the resources.</param> /// <returns>The localized display name.</returns> public string GetTypeDisplayName(ITypeInformation typeInformation, ITypeInformation typeInformationForResourceResolution) { ArgumentUtility.CheckNotNull("typeInformation", typeInformation); ArgumentUtility.CheckNotNull("typeInformationForResourceResolution", typeInformationForResourceResolution); return(_memberInformationGlobalizationService.GetTypeDisplayName(typeInformation, typeInformationForResourceResolution)); }