More Unit Tests
This commit is contained in:
28
TelloDroneUnitTests/ConsoleLoggerTests.cs
Normal file
28
TelloDroneUnitTests/ConsoleLoggerTests.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Tello_Drone;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
public class ConsoleLoggerTests
|
||||
{
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LogTest()
|
||||
{
|
||||
var correctMessageSent = false;
|
||||
var console = new ConsoleLogger();
|
||||
var test = "Test";
|
||||
console.LogReceived += delegate(string s) { correctMessageSent |= s == test; };
|
||||
console.Log(test);
|
||||
Assert.AreEqual(correctMessageSent, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user