public void CheckoutFileForEdit_FileDoesNotExistOnServer_ThrowsException()
        {
            var collection = Substitute.For <TfsTeamProjectCollection>(_uri);
            var handler    = new TestableTfsFileHandler(collection, Filename, false, false, false);

            Assert.Throws <Exception>(() => handler.CheckoutFileForEdit());
        }
        public void AddFile_FileDoesNotExistOnFileSystem_ThrowsException()
        {
            var collection = Substitute.For <TfsTeamProjectCollection>(_uri);
            var handler    = new TestableTfsFileHandler(collection, Filename, true, false, false);

            Assert.Throws <Exception>(() => handler.AddFile());
        }
        public void CheckoutFileForDelete_OneFileUpdated_ReturnsFalse()
        {
            var  collection = Substitute.For <TfsTeamProjectCollection>(_uri);
            var  handler    = new TestableTfsFileHandler(collection, Filename, true, true, false, 1);
            bool success    = handler.CheckoutFileForDelete();

            Assert.True(success);
        }
        public void AddFile_ZeroFilesUpdated_ReturnsFalse()
        {
            var  collection = Substitute.For <TfsTeamProjectCollection>(_uri);
            var  handler    = new TestableTfsFileHandler(collection, Filename, false, true, false, 0);
            bool success    = handler.AddFile();

            Assert.False(success);
        }
        public void CheckoutFileForDelete_HasPendingEditChanges_ReturnsTrue()
        {
            var  collection = Substitute.For <TfsTeamProjectCollection>(_uri);
            var  handler    = new TestableTfsFileHandler(collection, Filename, true, true, true, 0);
            bool success    = handler.CheckoutFileForDelete();

            Assert.True(success);
        }