Advertisement
BSO90

Untitled

Aug 9th, 2021
752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.26 KB | None | 0 0
  1.  [TestMethod]
  2.         public void ToStringMethod_Should_Return()
  3.         {
  4.             int id = 1;
  5.             string title = "mytesttitle";
  6.             string description = "this is a test description";
  7.             var steps = new List<string>();
  8.             Priority priority = Priority.Low;
  9.             Severity severity = Severity.Minor;
  10.             string boardName = "testboard";
  11.             string assignee = "no assignee";
  12.             var testObject = new Bug(id, title, description, steps, priority, severity, boardName);
  13.  
  14.             var actual = testObject.ToString();
  15.  
  16.             var builder = new StringBuilder();
  17.             builder.AppendLine($"Task type: BUG");
  18.             builder.AppendLine($"Title: \"{title}\"");
  19.             builder.AppendLine($"Description: \"{description}\"");
  20.             builder.AppendLine($"Status: {Status.Active}");
  21.             builder.AppendLine($"Severity: {severity}");
  22.             builder.AppendLine($"Priority: {priority}");
  23.             builder.AppendLine($"Assignee: {assignee}");
  24.             foreach (string step in steps)
  25.             {
  26.                 builder.AppendLine(step);
  27.             }
  28.  
  29.             var expected = builder.ToString().TrimEnd();
  30.  
  31.             Assert.AreEqual(expected, actual);
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement