This repository was archived by the owner on Nov 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from equelin/develop
Deploy release 0.13.0
- Loading branch information
Showing
292 changed files
with
8,899 additions
and
3,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#importing the module with the using statement, classes will be available in the session | ||
using module '..\..\Unity-Powershell' | ||
|
||
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
|
||
#import module | ||
$Module = Get-Module -Name 'Unity-Powershell' | ||
|
||
# Get classes defined by the module | ||
$ActualClasses = $Module.ImplementingAssembly.DefinedTypes | where-Object IsPublic | Where-Object {$_.Name -notlike '*Enum'} | ||
|
||
$Datas = @( Get-ChildItem -Path $here\Data\*.json -ErrorAction SilentlyContinue ) | ||
|
||
#Dot source the files - idea from https://becomelotr.wordpress.com/2017/02/13/expensive-dot-sourcing/ | ||
Foreach($Data in $Datas) { | ||
|
||
# Load the references datas | ||
$APITypes = Get-Content $Data.fullname | ConvertFrom-Json | ||
|
||
Describe -Name "Testing Class against file $($Data.Name)" { | ||
|
||
#Test all classes from module | ||
Foreach ($Class in $ActualClasses) { | ||
|
||
#Create an empty object in order to retrieve it's propoerties | ||
$Object = New-Object -TypeName $Class.name | ||
|
||
#Get properties of the object | ||
$ObjectProperties = $Object | Get-Member | Where-Object {$_.MemberType -eq 'Property'} | ||
|
||
#Remove 'Unity' from the name of the class | ||
$APIClassName = ($Class.name) -replace 'Unity','' | ||
|
||
#Find the definition of the class in the API | ||
$APIClass = $APITypes.entries.content | Where-Object {$_.Name -eq $APIClassName} | ||
|
||
Context -Name "Class $($Class.name)" { | ||
|
||
foreach ($Attribute in $APIClass.attributes.name) { | ||
|
||
It -Name "Attribute $Attribute is defined" { | ||
$ObjectProperties.Name -contains $Attribute | Should Be $True | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Remove module | ||
Remove-Module $Module | ||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,4 @@ Describe "Functions Parameters" { | |
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,4 +299,4 @@ foreach ($command in $commands) { | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.