It"works with strict mode when using 'switch' style tests"{Set-StrictMode-VersionLatest{throw'Test'}|ShouldThrow{throw'Test'}|Should-Throw}

Context"for positive assertions"{

$parsedArgs=Parse-ShouldArgstestMethod,1

It"gets the expected value from the 2nd argument"{$ParsedArgs.ExpectedValue|ShouldBe1}

It"marks the args as a positive assertion"{$ParsedArgs.PositiveAssertion|ShouldBe$true}}

Context"for negative assertions"{

$parsedArgs=Parse-ShouldArgsNot,testMethod,1

It"gets the expected value from the third argument"{$ParsedArgs.ExpectedValue|ShouldBe1}

It"marks the args as a negative assertion"{$ParsedArgs.PositiveAssertion|ShouldBe$false}}}

Describe-Tag"Acceptance""Should"{It"can use the Be assertion"{1|ShouldBe11|Should-Be1}

It"can use the Not Be assertion"{1|ShouldNotBe21|Should-Not-Be2}

It"can use the BeNullOrEmpty assertion"{$null|ShouldBeNullOrEmpty@()|ShouldBeNullOrEmpty""|ShouldBeNullOrEmpty$null|Should-BeNullOrEmpty@()|Should-BeNullOrEmpty""|Should-BeNullOrEmpty}

It"can use the Not BeNullOrEmpty assertion"{@("foo")|ShouldNotBeNullOrEmpty"foo"|ShouldNotBeNullOrEmpty" "|ShouldNotBeNullOrEmpty@(1,2,3)|ShouldNotBeNullOrEmpty12345|ShouldNotBeNullOrEmpty@("foo")|Should-Not-BeNullOrEmpty"foo"|Should-Not-BeNullOrEmpty" "|Should-Not-BeNullOrEmpty@(1,2,3)|Should-Not-BeNullOrEmpty12345|Should-Not-BeNullOrEmpty$item1=New-ObjectPSObject-Property@{Id=1;Name="foo"}$item2=New-ObjectPSObject-Property@{Id=2;Name="bar"}@($item1,$item2)|ShouldNotBeNullOrEmpty@($item1,$item2)|Should-Not-BeNullOrEmpty}

# TODO understand the purpose of this test, perhaps some better wordingIt"can process functions with empty output as input"{functionReturnNothing{}

# TODO figure out why this is the caseif($PSVersionTable.PSVersion-eq"2.0"){{$(ReturnNothing)|ShouldNotBeNullOrEmpty}|ShouldNotThrow{$(ReturnNothing)|Should-Not-BeNullOrEmpty}|Should-Not-Throw}else{{$(ReturnNothing)|ShouldNotBeNullOrEmpty}|ShouldThrow{$(ReturnNothing)|Should-Not-BeNullOrEmpty}|Should-Throw}}

# Assertion messages aren't convention-based anymore, but we should probably still make sure# that our tests are complete (including negative tests) to verify the proper messages get# returned. Those will need to exist in other tests files.