Guest User

Untitled

a guest
Jun 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. Input:
  2.  
  3. When a @User(Peter) #ProposeTo another @User(Patty)
  4. and @User(Peter) #Marry another @User(Patty)
  5. and @User(Peter) ~Name is ("Peter")
  6. and @User(Patty) ~Name is ("Patty"),
  7. @User(Patty) ~LastName should be the same as @User(Peter) ~LastName
  8. and each @User should have ~Spouse as the other @User
  9. and should have ~UnMarried as (false)
  10. and should have ~Age less than (21)
  11.  
  12. Output:
  13.  
  14. [Test]
  15. public void When_User_ProposeTo_User()
  16. {
  17. IUser Peter = ObjectFactory.GetInstance<IUser>();
  18. IUser Patty = ObjectFactory.GetInstance<IUser>();
  19. Peter.ProposeTo(Patty);
  20. Peter.Marry(Patty);
  21. Peter.Name = "Peter";
  22. Patty.Name = "Patty";
  23. Assert.IsTrue(Patty.LastName == Peter.LastName, "Failed: Patty.LastName == Peter.LastName");
  24. Assert.IsTrue(!Peter.UnMarried, "Failed: !Peter.UnMarried");
  25. Assert.IsTrue(Peter.Age < 21, "Failed: Peter.Age < 21");
  26. Assert.IsTrue(!Patty.UnMarried, "Failed: !Patty.UnMarried");
  27. Assert.IsTrue(Patty.Age < 21, "Failed: Patty.Age < 21");
  28. Assert.IsTrue(Peter.Spouse == Patty, "Failed: Peter.Spouse == Patty");
  29. Assert.IsTrue(Patty.Spouse == Peter, "Failed: Patty.Spouse == Peter");
  30. }
Add Comment
Please, Sign In to add comment