public void Constructor_ShouldSetTheBufferPropertyToACopyOfTheBufferParameterValue() { // ReSharper disable PossibleMultipleEnumeration byte[] bufferParameterValue = new byte[] {0, 1, 2, 3}; IEnumerable<byte> bufferPropertyValue = new StreamWriteEventArgs(bufferParameterValue, 0, 0, Mock.Of<Encoding>()).Buffer; Assert.AreNotEqual(bufferParameterValue, bufferPropertyValue); Assert.AreEqual(bufferParameterValue.Length, bufferPropertyValue.Count()); Assert.AreEqual(bufferParameterValue[0], bufferPropertyValue.ElementAt(0)); Assert.AreEqual(bufferParameterValue[1], bufferPropertyValue.ElementAt(1)); Assert.AreEqual(bufferParameterValue[2], bufferPropertyValue.ElementAt(2)); Assert.AreEqual(bufferParameterValue[3], bufferPropertyValue.ElementAt(3)); // ReSharper restore PossibleMultipleEnumeration }
protected internal virtual void OnCaptureWrite(StreamWriteEventArgs e) { if(this.HasCaptureWriteEvents) this.CaptureWrite(this, e); }
private static void CaptureWriteEventHandler(object sender, StreamWriteEventArgs e) { }