Exemplo n.º 1
0
        public void AddNewRange_FilesAreAdded()
        {
            var uploadList = new UploadList(_helpers);
            var addFiles   = new List <string> {
                "a", "b"
            };

            uploadList.AddNewRange(addFiles);

            Assert.That(uploadList.Select(x => x.FullPath).ToList(), Is.EqualTo(addFiles));
        }
Exemplo n.º 2
0
        public void AddNewRange_WithDuplicates_DuplicatesAreNotAdded()
        {
            const string duplicatePath = "a";
            var          uploadList    = new UploadList(_helpers)
            {
                new UploadFile {
                    FullPath = duplicatePath
                },
                new UploadFile {
                    FullPath = "b"
                },
            };

            var addFiles = new List <string> {
                duplicatePath, "c"
            };

            uploadList.AddNewRange(addFiles);

            Assert.That(uploadList.Count, Is.EqualTo(3));
            Assert.That(uploadList.Count(x => x.FullPath == duplicatePath), Is.EqualTo(1));
        }