Commit Graph
24 Commits
Author SHA1 Message Date
Hugh Bellamy 0eda3eb260 Migrate old System.Text.Encoding.Extensions tests to System.Text.Encoding
Fixes dotnet/corefx#8114


Commit migrated from https://github.com/dotnet/corefx/commit/bb137246b0ac13069b82b0871bb37b35cb6fb6a7
2016-05-01 11:12:00 +01:00
Hugh Bellamy ae47d97cca Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/b4f0e88675d29071f0c8c6c2c1ccc1243c86569c
2016-04-30 12:26:09 +01:00
Hugh Bellamy df15bd2e5b Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/e90b02cf76f4d6286726bb20eebe57512090499e
2016-04-29 16:05:33 +01:00
Hugh Bellamy 3eaa522cfc Support invalid UTF16 byte sequence in System.Text.Encoding tests
Commit migrated from https://github.com/dotnet/corefx/commit/986d17d54ea55c687368b7028e97fce7eaede008
2016-04-28 19:42:30 +01:00
Hugh Bellamy 55e3d33376 Make sure all constructors for any Encoding have the same GetMaxCharCount and GetMaxByteCount results
Commit migrated from https://github.com/dotnet/corefx/commit/3c69470d1f3adce4ef98afc0c04ae611737aab87
2016-04-26 18:21:13 +01:00
Hugh Bellamy 671a801dd2 Add tests for EncoderFallback and DecoderFallback for UnicodeEncoding
- Take advantage of recently added NegativeEncodingTests.Encode_Invalid
helper


Commit migrated from https://github.com/dotnet/corefx/commit/506fd4a1103d4d19fb61ec552dc6088d28168989
2016-04-26 18:15:44 +01:00
Hugh Bellamy b5eecb5fd7 Add ctor, method and property tests to UnicodeEncoding
- Ctor, Ctor_Bool, Ctor_Bool_Bool
- EncoderFallback, DecoderFallback
- WebName, CodePage, EncodingName, IsSingleByte
- Clone, Equals, GetPreamble


Commit migrated from https://github.com/dotnet/corefx/commit/0e963579f6be6846b72ebaa4a62a242a2af18c66
2016-04-25 18:59:08 +01:00
Hugh Bellamy 65029542c3 Add more negative tests to System.Text.Encoding
- Null byte[] in GetBytes()
- Make sure GetMaxByteCount and GetMaxCharCount respect the MaxCharCount
property of EncoderFallback and DecoderFallback


Commit migrated from https://github.com/dotnet/corefx/commit/dd9b6990ace8e90ef557626e2e66c4a6061ad351
2016-04-24 13:09:04 +01:00
Hugh Bellamy d37d6e8fb1 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/b393dfb90bb1aecc6f7500120840eae038fdfc26
2016-04-22 19:12:30 +01:00
Hugh Bellamy 1e9619a74c Move legacy UnicodeEncoding tests to modern files
- Take advantage of EncodingTestHelpers and NegativeEncodingTestHelpers
to remove boilerplate and duplicated code/tests (e.g. we don't need to
test data for all overloads or GetCharCount/GetByteCount as the helpers
handle this for us)
- Move encode and decode tests to the new files


Commit migrated from https://github.com/dotnet/corefx/commit/fc607f9119c24939aa78af0f0908fe54fc5f271f
2016-04-22 18:20:12 +01:00
Hugh Bellamy f15da2ff38 Remove random data from System.Text.Encoding tests
Commit migrated from https://github.com/dotnet/corefx/commit/c8dd21919875419202bbf8277b776580c783b6aa
2016-04-21 21:32:38 +01:00
Hugh Bellamy 53944240c3 Add tests for UnicodeEncoding
- All ASCII chars
- Valid surrogate pairs
- Invalid surrogate pairs
- Invalid unicode chars
- Invalid bytes


Commit migrated from https://github.com/dotnet/corefx/commit/3be7b3c8968cd558c4ccbedfa4e1b89bce9c63ad
2016-04-21 18:28:43 +01:00
Hugh Bellamy ce20775029 Add UTF8Encoding tests
- All ASCII chars
- Valid surrogate pairs
- Invalid surrogate pairs
- Invalid unicode chars
- Invalid bytes
- Change Decode(..., char[]) to Decode(..., string) for convenience


Commit migrated from https://github.com/dotnet/corefx/commit/96326160e8979c97bcc77e28a2e0c8960f4f45f7
2016-04-20 21:43:10 +01:00
Hugh Bellamy e64fce918c Consolidate GetByteCount/GetByte and GetChars/GetCharCount/GetString tests
- Less test code duplication


Commit migrated from https://github.com/dotnet/corefx/commit/1879fbb6fcc4dc5dd83a0458b28302e58d3868eb
2016-04-16 10:50:19 +01:00
Hugh Bellamy 2540ee56b3 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/609e9ab66c7ff6332665fe75dd7cfd1649daaed3
2016-03-31 18:13:04 +01:00
Hugh Bellamy 5afc5d0c67 Actually test GetBytes and GetChars in System.Text.Encoding
- Previous tests for GetBytes and GetChars did not test anything apart
from the return value: the method could've created any byte[] or char[]
result and we wouldn't have verified it.
- Also adds more coverage by testing more overloads of GetBytes and
GetChars


Commit migrated from https://github.com/dotnet/corefx/commit/2bd77a8c5f104624f403cb48c0bfabcdb9beaaf8
2016-03-31 11:34:56 +01:00
Hugh Bellamy 4350cb6024 Cleanup UTF7Encoding negative tests
- Make EncodingHelpers.cs more extensible


Commit migrated from https://github.com/dotnet/corefx/commit/2d49ba5a5d904ddd8a750fdd26e82089ca05a58f
2016-03-23 08:05:41 +00:00
Hugh Bellamy 5006c65d11 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/1d5a05a1a8c213d21c3fa678ae019636be260aad
2016-03-18 21:44:32 +00:00
Hugh Bellamy f9bdf1e4ae Cleanup UnicodeEncoding tests
- Rename tests to follow guidelines, instead of "PosTest1" and
"NegTest2"
- Take advantage of xunit
- Shorten tests by using quicker and newer code


Commit migrated from https://github.com/dotnet/corefx/commit/a40275630abae4e3a0d7b1857565307c0a63227c
2016-02-29 00:33:54 +00:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
Stephen A. Imhoff bc392f1c9f Update test namespace in System.Text.Encoding, per dotnet/corefx#2898 .
- Add namespace in lone file.
 - Clean up `using`s.


Commit migrated from https://github.com/dotnet/corefx/commit/72f17d002e22670de2d1b9a6528f451715969aaf
2015-10-02 16:35:35 +09:00
stephentoub b931aee629 Add missing license headers to .cs files
There are 77 .cs files in the repo lacking the standard license header we have on the other ~5400 .cs files.  This commit adds the missing ones.


Commit migrated from https://github.com/dotnet/corefx/commit/98157438d8790337f14341528f20d2f788a3279d
2015-07-21 18:52:55 -04:00
stephentoub ae493cc005 Fix System.Text.Encoding tests to use non-static RNG
Commit migrated from https://github.com/dotnet/corefx/commit/1b5d9fb7503cc01a6fba08b5d9bf0eb9cfb031b6
2015-07-14 22:15:30 -04:00
Venkatraman Mahalingam e157c69bbc Porting System.Text.Encoding from ToF and unified 4.0 and 4.10 tests into same folder
[tfs-changeset: 1474146]


Commit migrated from https://github.com/dotnet/corefx/commit/1394fa1c2539f289916b9c0641f81436b73e8794
2015-05-21 15:22:44 -07:00