コード例 #1
0
        public void ShouldBeFalseWhenFileIsEmpty()
        {
            // Arrange
            using var stream = new MemoryStream();
            var sut = new ImportBankAccountCommand(stream);

            // Assert
            sut.IsValid.Should().BeFalse();
        }
コード例 #2
0
        public void ShouldBeTrueWhenFileIsValid()
        {
            // Arrange
            using var stream = new MemoryStream();
            using var writer = new StreamWriter(stream);
            writer.WriteLine("Name,Amount");
            writer.WriteLine("Itau,1000");
            writer.Flush();
            stream.Position = 0;

            var sut = new ImportBankAccountCommand(stream);

            // Assert
            sut.IsValid.Should().BeTrue();
        }