public void No_users() { var url = "/users"; var database = "[]"; var sut = new RestApi.Api.RestApi(database); var actual = sut.Get(url); var expected = "[]"; Assert.Equal(expected, actual); }
public void Get_single_user() { var url = "/users"; var payload = "{\"users\":[\"Bob\"]}"; var database = "[{\"name\":\"Adam\",\"owes\":{},\"owed_by\":{},\"balance\":0.0},{\"name\":\"Bob\",\"owes\":{},\"owed_by\":{},\"balance\":0.0}]"; var sut = new RestApi.Api.RestApi(database); var actual = sut.Get(url, payload); var expected = "[{\"name\":\"Bob\",\"owes\":{},\"owed_by\":{},\"balance\":0.0}]"; Assert.Equal(expected, actual); }