public void StactiveEvent_constructor_sets_datetime() { var stactiveEvent = new StactiveEvent("asd"); stactiveEvent.DateTime.ShouldNotBe(new DateTime()); stactiveEvent.DateTime.Kind.ShouldBe(DateTimeKind.Utc); }
public void StactiveEvent_constructor_sets_id_to_guid() { var stactiveEvent = new StactiveEvent("asd"); stactiveEvent.Id.ShouldNotBeNull(); stactiveEvent.Id.ShouldNotBe(new Guid()); }
public void AddEvent_adds_event_to_the_list() { var stactiveEvent = new StactiveEvent("asd"); var context = CreateHttpContext(); Stactive.AddEvent(context, stactiveEvent); var eventsList = context.Items[Stactive.StactiveEventsKey] as List <StactiveEvent>; eventsList.ShouldContain(stactiveEvent); }
public static void AddEvent(HttpContext context, StactiveEvent stactiveEvent) { if (!context.Items.ContainsKey(StactiveEventsKey)) { context.Items[StactiveEventsKey] = new List <StactiveEvent>(); } var list = context.Items[StactiveEventsKey] as List <StactiveEvent>; if (list is null) { throw new StactiveException("Stactive events is not a List<StactiveEvent>"); } list.Add(stactiveEvent); }
public void StactiveEvent_constructor_sets_name() { var stactiveEvent = new StactiveEvent("asd"); stactiveEvent.Name.ShouldBe("asd"); }