Exemplo n.º 1
0
        public async Task WriteCommandAsync_Should_Write_CommandName()
        {
            VersionCommand versionCommand = new VersionCommand();

            await using MemoryStream memoryStream = new MemoryStream();

            await versionCommand.WriteCommandAsync(memoryStream).ConfigureAwait(false);

            byte[] commandData = memoryStream.ToArray();

            string actual = Encoding.UTF8.GetString(commandData);

            actual.Should()
            .Be($"{Consts.COMMAND_PREFIX_CHARACTER}{versionCommand.Name}{(char)Consts.TERMINATION_BYTE}");
        }