Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct gestion [System.String] vs [String] #115

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Code/Functions/Public/Write-CUPesterTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,12 @@ Function Write-CUPesterTest {
[void]$sb.AppendLine("$MethodCall" + '| should be $null')
}
else {

[void]$sb.AppendLine("($MethodCall).GetType().Name | should be $ReturnType")
if ($Method.ReturnType -like "*System.*") {
[void]$sb.AppendLine("($MethodCall).GetType().FullName | should be $ReturnType")
}
else {
[void]$sb.AppendLine("($MethodCall).GetType().Name | should be $ReturnType")
}
}


Expand Down
68 changes: 34 additions & 34 deletions PSClassUtils/PSClassUtils.psd1
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
#
# Module manifest for module 'PSGet_PSClassUtils'
# Manifeste de module pour le module ��PSGet_PSClassUtils��
#
# Generated by: Stéphane van Gulick
# G�n�r� par�: Stéphane van Gulick
#
# Generated on: 3/10/2019
# G�n�r� le�: 02/08/2019
#

@{

# Script module or binary module file associated with this manifest.
# Module de script ou fichier de module binaire associ� � ce manifeste
RootModule = 'PSClassUtils.psm1'

# Version number of this module.
# Num�ro de version de ce module.
ModuleVersion = '2.6.3'

# Supported PSEditions
# �ditions PS prises en charge
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
# ID utilis� pour identifier de mani�re unique ce module
GUID = 'c60f1a5b-deb3-44e7-8193-77aaa92ffb42'

# Author of this module
# Auteur de ce module
Author = 'Stéphane van Gulick'

# Company or vendor of this module
# Soci�t� ou fournisseur de ce module
CompanyName = 'District'

# Copyright statement for this module
# D�claration de copyright pour ce module
Copyright = '(c) 2018 TAAVAST3. All rights reserved.'

# Description of the functionality provided by this module
# Description de la fonctionnalit� fournie par ce module
Description = 'Contains a set of utilities to work with Powershell Classes.'

# Minimum version of the Windows PowerShell engine required by this module
# Version minimale du moteur Windows PowerShell requise par ce module
PowerShellVersion = '5.0'

# Name of the Windows PowerShell host required by this module
# Nom de l'h�te Windows PowerShell requis par ce module
# PowerShellHostName = ''

# Minimum version of the Windows PowerShell host required by this module
# Version minimale de l'h�te Windows PowerShell requise par ce module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# Version minimale du Microsoft .NET Framework requise par ce module. Cette configuration requise est valide uniquement pour PowerShell Desktop Edition.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# Version minimale de l�environnement CLR (Common Language Runtime) requise par ce module. Cette configuration requise est valide uniquement pour PowerShell Desktop Edition.
# CLRVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# Architecture de processeur (None, X86, Amd64) requise par ce module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
# Modules qui doivent �tre import�s dans l'environnement global pr�alablement � l'importation de ce module
# RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# Assemblys qui doivent �tre charg�s pr�alablement � l'importation de ce module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# Fichiers de script (.ps1) ex�cut�s dans l�environnement de l�appelant pr�alablement � l�importation de ce module
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# Fichiers de types (.ps1xml) � charger lors de l'importation de ce module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# Fichiers de format (.ps1xml) � charger lors de l'importation de ce module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# Modules � importer en tant que modules imbriqu�s du module sp�cifi� dans RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
# Fonctions � exporter � partir de ce module. Pour de meilleures performances, n�utilisez pas de caract�res g�n�riques et ne supprimez pas l�entr�e. Utilisez un tableau vide si vous n�avez aucune fonction � exporter.
FunctionsToExport = 'Get-CUClass', 'Get-CUClassConstructor', 'Get-CUClassMethod',
'Get-CUClassProperty', 'Get-CUCommands', 'Get-CUEnum',
'Get-CULoadedClass', 'Get-CURaw', 'Install-CUDiagramPrerequisites',
'Test-IsCustomType', 'Write-CUClassDiagram',
'Write-CUInterfaceImplementation', 'Write-CUPesterTest'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
# Applets de commande � exporter � partir de ce module. Pour de meilleures performances, n�utilisez pas de caract�res g�n�riques et ne supprimez pas l�entr�e. Utilisez un tableau vide si vous n�avez aucune applet de commande � exporter.
CmdletsToExport = @()

# Variables to export from this module
# Variables � exporter � partir de ce module
VariablesToExport = '*'

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
# Alias � exporter � partir de ce module. Pour de meilleures performances, n�utilisez pas de caract�res g�n�riques et ne supprimez pas l�entr�e. Utilisez un tableau vide si vous n�avez aucun alias � exporter.
AliasesToExport = @()

# DSC resources to export from this module
# Ressources DSC � exporter depuis ce module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# Liste de tous les modules empaquet�s avec ce module
# ModuleList = @()

# List of all files packaged with this module
# Liste de tous les fichiers empaquet�s avec ce module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
# Donn�es priv�es � transmettre au module sp�cifi� dans RootModule/ModuleToProcess. Cela peut �galement inclure une table de hachage PSData avec des m�tadonn�es de modules suppl�mentaires utilis�es par PowerShell.
PrivateData = @{

PSData = @{
Expand Down Expand Up @@ -133,7 +133,7 @@ PrivateData = @{
# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
Expand All @@ -143,10 +143,10 @@ PrivateData = @{

} # End of PrivateData hashtable

# HelpInfo URI of this module
# URI HelpInfo de ce module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# Le pr�fixe par d�faut des commandes a �t� export� � partir de ce module. Remplacez le pr�fixe par d�faut � l�aide d�Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
Expand Down
10 changes: 7 additions & 3 deletions PSClassUtils/PSClassUtils.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated at 03/10/2019 21:20:24 by Stephane van Gulick
#Generated at 08/02/2019 15:00:50 by Stephane van Gulick
#Needed for 07_CUInterfaceAuthor

using namespace System.Collections.Generic
Expand Down Expand Up @@ -2389,8 +2389,12 @@ Function Write-CUPesterTest {
[void]$sb.AppendLine("$MethodCall" + '| should be $null')
}
else {

[void]$sb.AppendLine("($MethodCall).GetType().Name | should be $ReturnType")
if ($Method.ReturnType -like "*System.*") {
[void]$sb.AppendLine("($MethodCall).GetType().FullName | should be $ReturnType")
}
else {
[void]$sb.AppendLine("($MethodCall).GetType().Name | should be $ReturnType")
}
}


Expand Down