Files
dotnet-runtime/src/libraries/System.Text.Encoding/tests/Latin1Encoding/Latin1EncodingGetMaxByteCount.cs
T
Hugh Bellamy 088cceb472 Add Latin1Encoding tests
- Decode, Encode
- GetMaxCharCount, GetMaxByteCount
- GetPreamble, Clone, Equals
- EncoderFallback, DecoderFallback
- CodePage, WebName, EncodingName, IsSingleByte

Also fixes up the NegativeEncodingTests to not hardcode specific
Encodings

Contributes to dotnet/corefx#8114


Commit migrated from https://github.com/dotnet/corefx/commit/8714473001b21a33a173e72617d0abac7fc8999d
2016-04-27 20:47:25 +01:00

21 lines
584 B
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Xunit;
namespace System.Text.Tests
{
public class Latin1EncodingGetMaxByteCount
{
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(int.MaxValue - 1)]
public void GetMaxByteCount(int charCount)
{
Assert.Equal(charCount + 1, Encoding.GetEncoding("latin1").GetMaxByteCount(charCount));
}
}
}