public void ValidateAndThrowDoesNotThrowAnyExceptionForValidBuffer()
        {
            var bufferValidator = new BufferValidator();

            var validBuffer = Entities.GetValidBuffer();

            bufferValidator.ValidateAndThrow(validBuffer);
        }
Esempio n. 2
0
        public FileWriter(string filePath, IBuffer buffer)
        {
            FilePathValidator.ValidateAndThrow(filePath, false);
            BufferValidator.ValidateAndThrow(buffer);

            fileStream = new FileStream(filePath, FileMode.OpenOrCreate);

            FilePath = filePath;
            Buffer   = buffer;

            Buffer.OnCurrentBitReset += OnCurrentBitReset;
        }
Esempio n. 3
0
        public FileReader(string filePath, IBuffer buffer)
        {
            FilePathValidator.ValidateAndThrow(filePath);
            BufferValidator.ValidateAndThrow(buffer);

            FilePath = filePath;
            Buffer   = buffer;

            fileStream = new FileStream(filePath, FileMode.Open);
            BitsLeft   = fileStream.Length * 8;

            Buffer.OnCurrentBitReset += OnCurrentBitReset;
            Buffer.Value              = (byte)fileStream.ReadByte();
        }
        public void ValidateAndThrowThrowsArgumentNullExceptionForNullBuffer()
        {
            var bufferValidator = new BufferValidator();

            bufferValidator.ValidateAndThrow(null);
        }