public void WhenUsingNullByteArrayTheReaderMustThrowArgumentNullException() { var readerclass = new XmlSchemaReader(new FileSystem(), new MemoryStreamFactory()); const byte[] array = null; readerclass.ReadFromByteArray(array); Assert.Fail("Should not reach this point."); }
public void WhenMemoryStreamFactoryThrowsExceptionTheReaderMustThrowInvalidOperationException() { var fakeFs = A.Fake <IFileSystem>(); var fakeMemoryFactory = A.Fake <IMemoryStreamFactory>(); var array = new byte[1] { Convert.ToByte(true) }; A.CallTo(() => fakeMemoryFactory.Create(array, false)).WithAnyArguments().Throws <Exception>(); var readerclass = new XmlSchemaReader(fakeFs, fakeMemoryFactory); readerclass.ReadFromByteArray(array); Assert.Fail("Should not reach this point."); }