DotnetStandardStreams/source/DotnetStreamsTests/ListOutputTargetTests.cs
2025-05-15 13:27:49 -06:00

28 lines
598 B
C#

using DotnetStreams;
using System;
using System.Collections.Generic;
using Xunit;
using Shouldly;
namespace DotnetStreamsTests
{
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");
}
}
}