//api/v1/defaultFilterName/{filterNamePrefix} public async Task <HttpResponseMessage> GetDefaultFilterName(string prefix) { return(await GetServiceResponseAsync <string>(async() => { return await _filterLogic.GetAvailableFilterNameAsync(prefix); })); }
public async void GetAvailableFilterNameAsyncTests() { string prefix = "myFilter"; _deviceListFilterRepositoryMock.Setup(x => x.CheckFilterNameAsync(prefix)).ReturnsAsync(false); var ret = await _filterLogic.GetAvailableFilterNameAsync(prefix); Assert.Equal("myFilter1", ret); _deviceListFilterRepositoryMock.Setup(x => x.CheckFilterNameAsync(prefix)).ReturnsAsync(true); Assert.True(ret.StartsWith(prefix)); }