Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 1.01 KB

File metadata and controls

26 lines (22 loc) · 1.01 KB

Version 1 Example

This is not intended to be a complete example. Please see the UnitTestWithVersion1 for that.

Version 1.1 Simple Usage Example

def commonArrange():
      TestSubject(False)

test = DeclareATest().ArrangedBy(self.commonArrange)\
            .ThatExpects(lambda s: """Lambda to Check Expectation, returns true if passed.""","Error Massage for when check fails.")\
            .When(lambda context: """Act on context[TestComponents.Subject]""")
    test.Run()

You can do multiple actions in your action function, and you can setup multiple expectations:

def action(context):
        context[TestComponents.Subject].SetFlagTrue()
        context[TestComponents.Subject].SetName('John')

test = DeclareAtest().ArrangedBy(self.commonArrange)\
        .ThatExpects(lambda s: s.GetFlag() is True,"Subject flag was not True")\
        .ThatExpects(lambda s: s.GetName() == 'John',"Subject name was not John")\
        .When(action)
test.Run()