-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpeakerTests.cs
41 lines (35 loc) · 976 Bytes
/
SpeakerTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.IO;
using NUnit.Framework;
namespace HelloWorld.Tests
{
[TestFixture]
public class SpeakerTests
{
[Test]
public void Speak_ShouldPrintHelloWorld()
{
// Arrange
var speaker = new Speaker("Test Speaker", "Test Language", 30);
// Act
using (var consoleOutput = new ConsoleOutput())
{
speaker.Speak();
var output = consoleOutput.GetOuput();
// Assert
Assert.IsTrue(output.Contains("Hello World!"));
}
}
[Test]
public void GetSpeakerID_ShouldReturnIDInRange()
{
// Arrange
var speaker = new Speaker("Test Speaker", "Test Language", 30);
// Act
var id = speaker.SpeakerID;
// Assert
Assert.GreaterOrEqual(id, 1);
Assert.LessOrEqual(id, 1000);
}
}
}