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

            target.Should().BeNull();
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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> >();
        }
Beispiel #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
            });
        }