Skip to content

Conversation

@rubetsserhii
Copy link
Collaborator

No description provided.

.WillOnce(testing::Return(true));
}

void BeforeCopyFileTest(const std::string& srcFolder,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

название не очевидное

EXPECT_NO_THROW(fileCopier.Copy(s_srcFolder, s_dstFolder));
}

TEST(FileCopierTests, Copy_FolderWithoutFiles)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я не увидел, чтобы тест был красным.
Здесь или последовательность тестов неправильная или тест явно лишний

EXPECT_NO_THROW(fileCopier.Copy(s_srcFolder, s_dstFolder));
}

TEST(FileCopierTests, Copy_FileAndFolderWithFile)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а где красный тест?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Посути, этот тест делает то, для чего уже были красные и зеленые тесты. Только здесь идет проверка, что мы скопируем как файлы в текущей папке так и из другой папки, находящейся в этой.
С одной стороны то что он желает уже покрыто, но нам также нужно знать что он выполняет и эти функции.

const std::string dstPath(ConcatPath(dst, relativePath));
if (m_fileSystem->IsDirectory(srcFilePath))
{
Copy(srcFilePath, dstPath);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

меня смущает то, что если хотя бы один файл из иерархии будет отсутствовать, то мы не скопируем дальше ничего

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Идет проверка не существования файла, а существования папки. Ну и кроме проверки при первом вызове копирования, она больше не нужна. Следовало бы вынести функционал копирования в отдельную функцию.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants