Ejemplo n.º 1
0
        public void SyntaxTypeReference_WithScope_Nothing()
        {
            // arrange
            SyntaxTypeReference typeReference1 = TypeReference.Create(
                "Foo",
                TypeContext.Input,
                scope: "foo");

            // act
            SyntaxTypeReference typeReference2 = typeReference1.WithScope();

            // assert
            Assert.Equal(typeReference1.Type, typeReference2.Type);
            Assert.Equal(typeReference1.Context, typeReference2.Context);
            Assert.Null(typeReference2.Scope);
        }
        public void SyntaxTypeReference_WithScope()
        {
            // arrange
            SyntaxTypeReference typeReference1 = TypeReference.Create(
                "Foo",
                TypeContext.Input,
                scope: "foo",
                nullable: new[] { true });

            // act
            SyntaxTypeReference typeReference2 = typeReference1.WithScope("bar");

            // assert
            Assert.Equal(typeReference1.Type, typeReference2.Type);
            Assert.Equal(typeReference1.Context, typeReference2.Context);
            Assert.Equal("bar", typeReference2.Scope);
            Assert.Equal(typeReference1.Nullable, typeReference2.Nullable);
        }