DotnetStandardStreams/source/DotnetStandardStreamsTests/ListOutputTargetTests.cs

23 lines
537 B
C#

using System;
using System.Collections.Generic;
using DotnetStandardStreams;
namespace DotnetStandardStreamsTests;
public class ListOutputTargetTests
{
[Fact]
public void WritesToList()
{
ListOutputTarget target = new(new List<string>());
target.Output("1");
target.Output("2");
target.Output("");
target.Output("3");
target.OutputList.Count.ShouldBe(4);
target.OutputList[0].ShouldBe("1");
target.OutputList[1].ShouldBe("2");
target.OutputList[2].ShouldBe(string.Empty);
target.OutputList[3].ShouldBe("3");
}
}