Guest User

Untitled

a guest
Jul 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. [TestClass]
  2. public class GenerarBoletinDeClase
  3. {
  4. public TestContext TestContext { get; set; }
  5.  
  6. public static int Colegio { get; set; }
  7.  
  8. [ClassInitialize]
  9. public static void ClassInitialize(TestContext testContext)
  10. {
  11. Colegio = int.Parse(testContext.Properties["colegio"].ToString()); // colegio is equal 7 in here
  12. }
  13.  
  14. [TestInitialize]
  15. public void TestInitialize()
  16. {
  17. int tempColegio = int.Parse(this.TestContext.Properties["colegio"].ToString()); // colegio is equal 7 in here
  18. }
  19.  
  20. [TestMethod]
  21. public void TestMethod1()
  22. {
  23. int colegio = int.Parse(this.TestContext.Properties["colegio"].ToString()); // colegio is equal 7 in here as well
  24.  
  25. Assert.AreEqual(7, Colegio);
  26. Assert.AreEqual(7, colegio);
  27. Assert.AreEqual(colegio, Colegio);
  28. }
  29. }
  30.  
  31. public class TestBase
  32. {
  33. public TestContext TestContext { get; set; }
  34.  
  35. public static int Colegio { get; set; }
  36.  
  37. [AssemblyInitialize]
  38. public static void ClassInitialize(TestContext TestContext)
  39. {
  40. Colegio = int.Parse(TestContext.Properties["colegio"].ToString()); // colegio is equal 7 in here
  41. }
  42.  
  43. public TestBase()
  44. {
  45. SeleniumHelper = new HelperSelenium(Colegio, WebDriverSelector.ObtenerWebDriver());
  46. DiccionarioCompartido = new Dictionary<string, string>();
  47. }
Add Comment
Please, Sign In to add comment