Exemplo n.º 1
0
        public void WhenBuildingCleanTaskWithNameAndDirectoryPath__ShouldReturnConfiguredCleanTask()
        {
            const string pathToDirectory = "Path/To/Directory";
            const string expectedId      = "taskId";
            const string expectedName    = "taskName";

            CleanTaskBuilder sut = new CleanTaskBuilder(new MockFileSystem());

            CleanTask task = (CleanTask)sut
                             .With("Id", expectedId)
                             .With("Name", expectedName)
                             .With("Path", pathToDirectory)
                             .Build();

            Assert.AreEqual(expectedId, task.Id);
            Assert.AreEqual(expectedName, task.Name);
            Assert.AreEqual(pathToDirectory, task.Path);
        }
Exemplo n.º 2
0
        public void WhenBuildingCleanTaskWithUnknownConfigOption__ShouldThrowInvalidOperationException()
        {
            CleanTaskBuilder sut = new CleanTaskBuilder(new MockFileSystem());

            sut.With("Unknown", "").Build();
        }