Ejemplo n.º 1
0
        public void CanSetCustomPropertiesAndGenericProperties()
        {
            string document = CustomObject
                              .Create()
                              .WithId(SetTo.Value("ID123"))
                              .With("description", SetTo.Value("This is a description"))
                              .WithName(SetTo.Value("Test"))
                              .With("Age", SetTo.Value(42))
                              .WithCat(SetTo.Null);

            Assert.Equal(
                @"{""id"":""ID123"",""description"":""This is a description"",""name"":""Test"",""Age"":42,""cat"":null}",
                document);
        }
Ejemplo n.º 2
0
        public void CanCreateCustomObject()
        {
            string document = CustomObject.Create();

            Assert.Equal("{}", document);
        }