public async System.Threading.Tasks.Task WhenGetAllAsync_ThenEntityTypesAreReturned() { // ACT var result = await _client.GetAllAsync(); // ASSERT Assert.NotNull(result); }
public async System.Threading.Tasks.Task WhenGetByEntityTypeAsync_IfExistCustomFieldsWithRightType_ThenAreReturned() { // ARRANGE var entityType = (await _entityTypeClient.GetAllAsync()).TaskEntity; var creationInformation = new CustomFieldCreationInformation() { Id = Guid.NewGuid(), Name = NamePrefix + Guid.NewGuid().ToString(), FieldType = CustomFieldType.TEXT, EntityType = entityType }; await _client.AddAsync(creationInformation); // ACT var result = await _client.GetAllByEntityTypeAsync(entityType); // ASSERT Assert.True(result.All(cf => cf.EntityType.ID == entityType.ID)); }
public async System.Threading.Tasks.Task WhenAddAsyncWithCustomFields_ThenPublishedTaskIsReturnedWithCustomFields() { // ARRANGE var taskModel = new TaskModel() { Id = Guid.NewGuid(), Name = Guid.NewGuid().ToString() }; var customFieldTextValue = Guid.NewGuid().ToString(); var customFields = await _customFieldClient.GetAllByEntityTypeAsync((await _entityTypeClient.GetAllAsync()).TaskEntity); var customField = customFields.First(cf => cf.FieldType == CustomFieldType.TEXT); taskModel.CustomFields = new Dictionary <CustomField, object>() { { customField, customFieldTextValue } }; // ACT var publishedTask = await _client.AddAsync(_publishedProject, taskModel); // ASSERT Assert.NotNull(publishedTask); Assert.Equal(publishedTask[customField.InternalName], customFieldTextValue); }