Exemplo n.º 1
0
        public void AsSerializableObject_InitializedAsFunction_FunctionIsReturned()
        {
            string     function   = "function() { alert(''); }";
            ValidRange validRange = new ValidRange(function);
            object     target     = validRange.AsSerializableObject();

            target.Should().Be(function);
        }
Exemplo n.º 2
0
        public void AsSerializableObject_OnlyEndDateIsSet_ObjectIsSerialized()
        {
            DateTime   end        = DateTime.Today.AddDays(2);
            ValidRange validRange = new ValidRange(end);
            object     target     = validRange.AsSerializableObject();

            target.ShouldBeEquivalentTo(new
            {
                start = validRange.Start,
                end   = end.ToString("yyyy-MM-dd")
            });
        }