示例#1
0
        public void AsSerializableObject_InitializedAsEmptyArray_NullIsReturned()
        {
            EventCollection eventCollection = new EventCollection(new List <Event>());
            object          target          = eventCollection.AsSerializableObject();

            target.Should().BeNull();
        }
示例#2
0
        public void AsSerializableObject_InitializedAsFunction_FunctionIsReturned()
        {
            string          function        = "function() { alert(''); }";
            EventCollection eventCollection = new EventCollection(function, EventCollectionType.Function);
            object          target          = eventCollection.AsSerializableObject();

            target.Should().Be(function);
        }
示例#3
0
        public void AsSerializableObject_InitializedAsJsonFeed_UrlIsReturned()
        {
            string          url             = "http://www.google.co.uk";
            EventCollection eventCollection = new EventCollection(url, EventCollectionType.JsonFeed);
            object          target          = eventCollection.AsSerializableObject();

            target.Should().Be(url);
        }
示例#4
0
        public void AsSerializableObject_InitializedAsArray_ListOfSerializableEventIsReturned()
        {
            EventCollection eventCollection = new EventCollection(new List <Event> {
                new Event()
            });
            object target = eventCollection.AsSerializableObject();

            target.Should().BeAssignableTo <IEnumerable <SerializableEvent> >();
        }
示例#5
0
        public void AsSerializableObject_InitializedAsGoogleCalendarFeed_GoogleCalendarIdObjectIsReturned()
        {
            string          googleCalendarId = "*****@*****.**";
            EventCollection eventCollection  = new EventCollection(googleCalendarId, EventCollectionType.GoogleCalendarFeed);
            object          target           = eventCollection.AsSerializableObject();

            target.ShouldBeEquivalentTo(new
            {
                googleCalendarId = googleCalendarId
            });
        }