Created
December 29, 2010 20:45
-
-
Save hhariri/759053 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Subject("Encoding Enums")] | |
public class when_encoding_an_object_that_contains_an_enum | |
{ | |
Establish context = () => | |
{ | |
IEnumerable<IDataReader> readers = new List<IDataReader> { new JsonReader(new DataReaderSettings(), "application/.*json") }; | |
IEnumerable<IDataWriter> writers = new List<IDataWriter> { new JsonWriter(new DataWriterSettings(), "application/.*json") }; | |
codec = new DefaultCodec(new RegExBasedDataReaderProvider(readers), new RegExBasedDataWriterProvider(writers)); | |
}; | |
Because of = () => | |
{ | |
var data = new Foo {Baz = Bar.First}; | |
result = codec.Encode(data, "application/vnd.fubar+json"); | |
}; | |
It should_encode_correctly = () => | |
{ | |
result.Length.ShouldBeGreaterThan(0); | |
}; | |
static HttpClient client; | |
static DefaultCodec codec; | |
static byte[] result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment