Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Input:
- When a @User(Peter) #ProposeTo another @User(Patty)
- and @User(Peter) #Marry another @User(Patty)
- and @User(Peter) ~Name is ("Peter")
- and @User(Patty) ~Name is ("Patty"),
- @User(Patty) ~LastName should be the same as @User(Peter) ~LastName
- and each @User should have ~Spouse as the other @User
- and should have ~UnMarried as (false)
- and should have ~Age less than (21)
- Output:
- [Test]
- public void When_User_ProposeTo_User()
- {
- IUser Peter = ObjectFactory.GetInstance<IUser>();
- IUser Patty = ObjectFactory.GetInstance<IUser>();
- Peter.ProposeTo(Patty);
- Peter.Marry(Patty);
- Peter.Name = "Peter";
- Patty.Name = "Patty";
- Assert.IsTrue(Patty.LastName == Peter.LastName, "Failed: Patty.LastName == Peter.LastName");
- Assert.IsTrue(!Peter.UnMarried, "Failed: !Peter.UnMarried");
- Assert.IsTrue(Peter.Age < 21, "Failed: Peter.Age < 21");
- Assert.IsTrue(!Patty.UnMarried, "Failed: !Patty.UnMarried");
- Assert.IsTrue(Patty.Age < 21, "Failed: Patty.Age < 21");
- Assert.IsTrue(Peter.Spouse == Patty, "Failed: Peter.Spouse == Patty");
- Assert.IsTrue(Patty.Spouse == Peter, "Failed: Patty.Spouse == Peter");
- }
Add Comment
Please, Sign In to add comment