dsccommunity / FailoverClusterDsc

This module contains DSC resources for deployment and configuration of Windows Server Failover Cluster.
MIT License
60 stars 54 forks source link

xClusterNetwork: Fix xClusterNetwork errors for Windows Server 2012 #192

Closed codykonior closed 6 years ago

codykonior commented 6 years ago

Pull Request (PR) description

Wraps calls to the Update method on cluster network options in a test confirming that the method exists. The method doesn't exist on Windows Server 2012 because changing the object automatically updates. Not fixing it results in an error.

Tests have been added which change the mock on 2012 to not have an Update method. Then the tests are compared against 0 calls versus whatever number of calls is there for 2016.

This Pull Request (PR) fixes the following issues

Task list


This change is Reviewable

codecov-io commented 6 years ago

Codecov Report

Merging #192 into dev will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #192   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files         8      8           
  Lines       487    493    +6     
===================================
+ Hits        487    493    +6
johlju commented 6 years ago

@codykonior Thanks for this! I will review this as soon as I can. I'm away this weekend so if I can't get to it during the weekend, I will get to it next week. 🙂

codykonior commented 6 years ago

Style changes and variable rename done.

codykonior commented 6 years ago

I remember you saying you were travelling. Gentle reminder that this is ready for review again.

johlju commented 6 years ago

@codykonior I have this on my todo - will try to get to it tonight. 🙂

johlju commented 6 years ago

@codykonior Have to push this to later this weekend. Sorry for the delay. 😞

codykonior commented 6 years ago

In defense of psobject, it's documented and used in PowerShell Core and other DSC Resources with no indication it's going anywhere.

But I know some people prefer PowerShell conventions to .NET style ones and I could make the change easily so I've done so.

MemberType Method didn't work well because the mocks are a ScriptMethod type. However it appears there's a MemberType property of Methods which covers both so that's what I used.