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 async Task Adds_Api_To_List() { var apiDescriptions = new[] { new ServiceApiDescription() { ServiceId = "Test1" }, new ServiceApiDescription() { ServiceId = "Test2" } }; var store = new InMemoryApiStore(apiDescriptions); (await store.GetAllAsync()).Should().HaveCount(2); await store.StoreAsync(new ServiceApiDescription() { ServiceId = "Test3" }); var items = await store.GetAllAsync(); items.Should().HaveCount(3); items.Should().Contain(s => s.ServiceId == "Test1"); items.Should().Contain(s => s.ServiceId == "Test2"); items.Should().Contain(s => s.ServiceId == "Test3"); }
public async Task Returns_All_Items() { var apiDescriptions = new[] { new ServiceApiDescription() { ServiceId = "Test1" }, new ServiceApiDescription() { ServiceId = "Test2" }, new ServiceApiDescription() { ServiceId = "Test3" }, }; var store = new InMemoryApiStore(apiDescriptions); var items = await store.GetAllAsync(); items.Should().HaveCount(3); items.Should().Contain(s => s.ServiceId == "Test1"); items.Should().Contain(s => s.ServiceId == "Test2"); items.Should().Contain(s => s.ServiceId == "Test3"); }