public void ThrowExceptionOnSavingAnUnsupportedStream() { using (var otherStreamThanMemory = new BufferedStream(new MemoryStream())) using (var dataWriter = new BinaryWriter(otherStreamThanMemory)) Assert.Throws <BinaryDataSaver.UnableToSave>( () => BinaryDataSaver.SaveDataType(otherStreamThanMemory, typeof(object), dataWriter)); }
public void ThrowExceptionOnSavingAnInvalidObject() { Assert.Throws <NullReferenceException>( () => BinaryDataSaver.SaveDataType(null, typeof(object), null)); }