コード例 #1
0
        public void TwoTaskOutputKindsWithTheSameTextAreEqual_UsingWeakTypedEqualsMethod()
        {
            object kind1 = TaskOutputKind.Custom("alice");
            object kind2 = TaskOutputKind.Custom("alice");

            Assert.True(kind1.Equals(kind2));
        }
コード例 #2
0
        public void TwoTaskOutputKindsWithDifferentlyCasedTextAreNotEqual_UsingWeakTypedEqualsMethod()
        {
            object kind1 = TaskOutputKind.Custom("alice");
            object kind2 = TaskOutputKind.Custom("Alice");

            Assert.False(kind1.Equals(kind2));
        }
コード例 #3
0
        public void TwoTaskOutputKindsWithTheSameTextAreEqual_UsingStrongTypedEqualsMethod()
        {
            var kind1 = TaskOutputKind.Custom("alice");
            var kind2 = TaskOutputKind.Custom("alice");

            Assert.True(kind1.Equals(kind2));
        }
コード例 #4
0
        public void TwoTaskOutputKindsWithDifferentlyCasedTextAreNotEqual_UsingInequalityOperator()
        {
            var kind1 = TaskOutputKind.Custom("alice");
            var kind2 = TaskOutputKind.Custom("Alice");

            Assert.True(kind1 != kind2);
        }
コード例 #5
0
        public void TwoTaskOutputKindsWithTheSameTextAreEqual_UsingInequalityOperator()
        {
            var kind1 = TaskOutputKind.Custom("alice");
            var kind2 = TaskOutputKind.Custom("alice");

            Assert.False(kind1 != kind2);
        }
コード例 #6
0
        public void GetTaskOutputStoragePathReturnsExpectedValue()
        {
            const string taskId      = "test-task";
            var          taskStorage = new TaskOutputStorage(new Uri("http://example.test/"), taskId);

            var taskLogPath = taskStorage.GetOutputStoragePath(TaskOutputKind.TaskLog);

            Assert.Equal($"{taskId}/${TaskOutputKind.TaskLog.ToString()}/", taskLogPath);

            taskLogPath = taskStorage.GetOutputStoragePath(TaskOutputKind.TaskOutput);
            Assert.Equal($"{taskId}/${TaskOutputKind.TaskOutput.ToString()}/", taskLogPath);

            taskLogPath = taskStorage.GetOutputStoragePath(TaskOutputKind.TaskPreview);
            Assert.Equal($"{taskId}/${TaskOutputKind.TaskPreview.ToString()}/", taskLogPath);

            taskLogPath = taskStorage.GetOutputStoragePath(TaskOutputKind.Custom("foo"));
            Assert.Equal($"{taskId}/${TaskOutputKind.Custom("foo").ToString()}/", taskLogPath);
        }
コード例 #7
0
        public void GetTaskOutputStoragePathReturnsExpectedValue()
        {
            const string taskId = "test-task";
            var          task   = new CloudTask(taskId, "test");

            var taskLogPath = task.GetOutputStoragePath(TaskOutputKind.TaskLog);

            Assert.Equal($"{taskId}/${TaskOutputKind.TaskLog.ToString()}", taskLogPath);

            taskLogPath = task.GetOutputStoragePath(TaskOutputKind.TaskOutput);
            Assert.Equal($"{taskId}/${TaskOutputKind.TaskOutput.ToString()}", taskLogPath);

            taskLogPath = task.GetOutputStoragePath(TaskOutputKind.TaskPreview);
            Assert.Equal($"{taskId}/${TaskOutputKind.TaskPreview.ToString()}", taskLogPath);

            taskLogPath = task.GetOutputStoragePath(TaskOutputKind.Custom("foo"));
            Assert.Equal($"{taskId}/${TaskOutputKind.Custom("foo").ToString()}", taskLogPath);
        }
コード例 #8
0
        public void ATaskOutputKindIsNotEqualToNull_UsingStrongTypedEqualsMethod()
        {
            var kind = TaskOutputKind.Custom("alice");

            Assert.False(kind.Equals(NullKind));
        }
コード例 #9
0
 public void CustomTaskOutputKindStringisesToItsText()
 {
     Assert.Equal("alice", TaskOutputKind.Custom("alice").ToString());
 }
コード例 #10
0
        public void CannotCreateATaskOutputKindWithEmptyText()
        {
            var ex = Assert.Throws <ArgumentException>(() => TaskOutputKind.Custom(""));

            Assert.Equal("text", ex.ParamName);
        }
コード例 #11
0
        public void NullIsNotEqualToATaskOutputKind_UsingInequalityOperator()
        {
            var kind = TaskOutputKind.Custom("alice");

            Assert.True(NullKind != kind);
        }
コード例 #12
0
        public void ATaskOutputKindIsNotEqualToNull_UsingEqualityOperator()
        {
            var kind = TaskOutputKind.Custom("alice");

            Assert.False(kind == NullKind);
        }
コード例 #13
0
        public void ATaskOutputKindIsNotEqualToNull_UsingWeakTypedEqualsMethod()
        {
            object kind = TaskOutputKind.Custom("alice");

            Assert.False(kind.Equals(null));
        }