public void AsSerializableObject_InitializedAsEmptyArray_NullIsReturned() { EventCollection eventCollection = new EventCollection(new List <Event>()); object target = eventCollection.AsSerializableObject(); target.Should().BeNull(); }
public void AsSerializableObject_InitializedAsFunction_FunctionIsReturned() { string function = "function() { alert(''); }"; EventCollection eventCollection = new EventCollection(function, EventCollectionType.Function); object target = eventCollection.AsSerializableObject(); target.Should().Be(function); }
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); }
public void AsSerializableObject_InitializedAsArray_ListOfSerializableEventIsReturned() { EventCollection eventCollection = new EventCollection(new List <Event> { new Event() }); object target = eventCollection.AsSerializableObject(); target.Should().BeAssignableTo <IEnumerable <SerializableEvent> >(); }
public void AsSerializableObject_InitializedAsGoogleCalendarFeed_GoogleCalendarIdObjectIsReturned() { string googleCalendarId = "*****@*****.**"; EventCollection eventCollection = new EventCollection(googleCalendarId, EventCollectionType.GoogleCalendarFeed); object target = eventCollection.AsSerializableObject(); target.ShouldBeEquivalentTo(new { googleCalendarId = googleCalendarId }); }