예제 #1
0
        public void AsSerializableObject_InitializedAsFunction_FunctionIsReturned()
        {
            string       function     = "function() { alert(''); }";
            VisibleRange visibleRange = new VisibleRange(function);
            object       target       = visibleRange.AsSerializableObject();

            target.Should().Be(function);
        }
예제 #2
0
        public void AsSerializableObject_DateRangeIsSet_ObjectIsSerialized()
        {
            DateTime     start        = DateTime.Today;
            DateTime     end          = DateTime.Today.AddDays(2);
            VisibleRange visibleRange = new VisibleRange(start, end);
            object       target       = visibleRange.AsSerializableObject();

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