Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        public void TestAddOneItem()
        {
            _buffer.Add("One");
            Assert.That(_buffer.Count, Is.EqualTo(1));

            var array = _buffer.ToArray();

            Assert.That(array.Length, Is.EqualTo(1));
            Assert.That(array[0], Is.EqualTo("One"));
        }