public async Task Removes_Existing_Item() { var apiDescriptions = new[] { new ServiceApiDescription() { ServiceId = "Test1" }, new ServiceApiDescription() { ServiceId = "Test2" }, new ServiceApiDescription() { ServiceId = "Test3" }, }; var store = new InMemoryApiStore(apiDescriptions); (await store.GetAllAsync()).Should().HaveCount(3); await store.RemoveAsync("Test2"); var items = await store.GetAllAsync(); items.Should().HaveCount(2); items.Should().Contain(s => s.ServiceId == "Test1"); items.Should().Contain(s => s.ServiceId == "Test3"); items.Should().NotContain(s => s.ServiceId == "Test2"); }
public void Does_Not_Throw_When_Api_Not_Exists() { var apiDescriptions = new[] { new ServiceApiDescription() { ServiceId = "Test1" }, new ServiceApiDescription() { ServiceId = "Test2" }, new ServiceApiDescription() { ServiceId = "Test3" }, }; var store = new InMemoryApiStore(apiDescriptions); Func <Task> action = async() => await store.RemoveAsync("teseeesr"); action.Should().NotThrow(); }