Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #30 from equelin/develop
Browse files Browse the repository at this point in the history
Deploy release 0.13.0
  • Loading branch information
equelin authored Mar 15, 2017
2 parents ca064cf + 73ddf17 commit 87c738c
Show file tree
Hide file tree
Showing 292 changed files with 8,899 additions and 3,003 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Erwan Quélin and the community
Copyright (c) 2016-2017 Erwan Quélin and the community

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Unity-Powershell is a member of the DevHigh5 program from [{code} by Dell EMC(tm

![](./Medias/Unity-Powershell-Demo-01.gif)

With this module (version 0.12.0) you can manage:
With this module (version 0.13.0) you can manage:

- System (DNS,NTP...),
- Pools (Virtual and physical deployment),
Expand Down Expand Up @@ -184,6 +184,6 @@ For testing purpose you can query all the ressources of the array with the comma

# License

Copyright 2016 Erwan Quelin and the community.
Copyright 2016-2017 Erwan Quelin and the community.

Licensed under the MIT License.
54 changes: 54 additions & 0 deletions Tests/Class/Class.Tests.ps1
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 added Tests/Class/Data/UnityVSA-4_0.json
Binary file not shown.
Binary file added Tests/Class/Data/UnityVSA-4_1.json
Binary file not shown.
1 change: 1 addition & 0 deletions Tests/Function/Function.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ Describe "Functions Parameters" {
}
}
}

2 changes: 1 addition & 1 deletion Tests/Help/Module.Help.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,4 @@ foreach ($command in $commands) {
}
}
}
}
}
2 changes: 1 addition & 1 deletion Tests/Module/Unity-Powershell.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Describe -Tags 'VersionChecks' "Unity-Powershell manifest" {
It "has a valid version in the manifest" {
$script:manifest.Version -as [Version] | Should Not BeNullOrEmpty
}
}
}
Loading

0 comments on commit 87c738c

Please sign in to comment.