public void NewWorkItem_Succeeds() { var context = new EngineContext(client, projectId, projectName, personalAccessToken, logger); var sut = new WorkItemStore(context); var wi = sut.NewWorkItem("Task"); wi.Title = "Brand new"; var save = sut.SaveChanges(SaveMode.Item, true).Result; Assert.NotNull(wi); Assert.True(wi.IsNew); Assert.Equal(1, save.created); Assert.Equal(0, save.updated); Assert.Equal(-1, wi.Id.Value); }
public async Task NewWorkItem_Succeeds() { var logger = Substitute.For <IAggregatorLogger>(); var client = Substitute.For <WorkItemTrackingHttpClientBase>(new Uri(CollectionUrl), null); var context = new EngineContext(client, projectId, ProjectName, PersonalAccessToken, logger); var sut = new WorkItemStore(context); var wi = sut.NewWorkItem("Task"); wi.Title = "Brand new"; var save = await sut.SaveChanges(SaveMode.Default, false, CancellationToken.None); Assert.NotNull(wi); Assert.True(wi.IsNew); Assert.Equal(1, save.created); Assert.Equal(0, save.updated); Assert.Equal(-1, wi.Id.Value); }