private void AddRecentFile(string newFile) { if (_recentFiles.FirstOrDefault() == newFile) { return; } if (_recentFiles.FindAndMakeRecent(str => str == newFile) == null) { _recentFiles.Add(newFile); } var builder = new StringBuilder(); foreach (var file in _recentFiles) { builder.Append(file); builder.Append(';'); } builder.Length--; var persistance = ServiceRepository.Instance.FindService <IPersistantDataRepository>(); persistance.SetValue("RecentFiles", builder.ToString()); RecentFiles = _recentFiles.ToArray(); }
public void TestInitialization() { Assert.That(_buffer.Count, Is.EqualTo(0)); Assert.That(_buffer.Capacity, Is.EqualTo(5)); var array = _buffer.ToArray(); Assert.That(array.Length, Is.EqualTo(0)); }