public bool Equals(MockFile other) { if (string.CompareOrdinal(this.Filename, other.Filename) != 0) { return(false); } if (!this.LastModifiedTime.Equals(other.LastModifiedTime)) { return(false); } byte[] dataBytes = this.DataStream.GetBuffer(); byte[] otherDataBytes = other.DataStream.GetBuffer(); return(Util.ArraysEqual <byte>(dataBytes, otherDataBytes)); }
public bool Equals(MockFileSystem other) { if (this._files.Count != other._files.Count) { return(false); } foreach (string filename in _files.Keys) { MockFile file = _files[filename]; MockFile otherFile = _files[filename]; if (!file.Equals(otherFile)) { return(false); } } return(true); }
public void AddMockFile(MockFile file) { _files.Add(file.Filename, file); }