Beispiel #1
0
        public async Task EventCreateAndLink()
        {
            var mock = new Mock <ITimelineService>();

            mock.Setup(m => m.PutJsonAsync(It.IsAny <string>(), It.IsAny <object>())).Returns(TestUtils.GetCompletedTask(TimelineEventJson));

            var timelineEvent = await TimelineEvent.CreateAndLinkAsync(mock.Object, "Test Title", "Test Description", DateTime.Now, "-1.1234,1.1234", "ID1");

            mock.Verify(m => m.PutJsonAsync("TimelineEvent/Create", It.IsAny <object>()));
            mock.Verify(m => m.PutJsonAsync("Timeline/LinkEvent", It.IsAny <object>()));
        }