Ejemplo n.º 1
0
            public void Should_Throw_If_Property_Name_Is_Empty()
            {
                // Given
                var tfsThread = new TfsPullRequestCommentThread();

                // When
                var result = Record.Exception(() => tfsThread.SetValue(string.Empty, new object()));

                // Then
                result.IsArgumentOutOfRangeException("propertyName");
            }
Ejemplo n.º 2
0
            public void Should_Throw_If_Property_Collection_Is_Null()
            {
                // Given
                var tfsThread = new TfsPullRequestCommentThread();

                // When
                var result = Record.Exception(() => tfsThread.SetValue("key", 1));

                // Then
                result.IsInvalidOperationException();
            }
Ejemplo n.º 3
0
            public void Should_Throw_If_Property_Name_Is_Null()
            {
                // Given
                var tfsThread = new TfsPullRequestCommentThread();

                // When
                var result = Record.Exception(() => tfsThread.SetValue(null, string.Empty));

                // Then
                result.IsArgumentNullException("propertyName");
            }
Ejemplo n.º 4
0
            public void Should_Set_Valid_Properties()
            {
                // Given
                var tfsThread = new TfsPullRequestCommentThread(
                    new GitPullRequestCommentThread
                {
                    Id         = 42,
                    Status     = CommentThreadStatus.Active,
                    Properties = new PropertiesCollection {
                        { "one", 1 }
                    },
                });

                // When
                tfsThread.SetValue("one", "string");
                tfsThread.SetValue("two", 2);

                // Then
                tfsThread.Properties.ShouldNotBeNull();
                tfsThread.Properties.ShouldNotBeEmpty();
                tfsThread.Properties.ShouldContainKeyAndValue("one", "string");
                tfsThread.Properties.ShouldContainKeyAndValue("two", 2);
            }