public async Task GetErgodoxLayout(string layoutHashId, bool exist) { // Arrange ILayoutService layoutService = new LayoutService(); // Act ErgodoxLayout response = null; if (exist) { response = await layoutService.GetErgodoxLayout(layoutHashId, "ergodox-ez", "latest"); } else { await Assert.ThrowsAsync <ArgumentException>(() => layoutService.GetErgodoxLayout(layoutHashId, "ergodox-ez", "latest")); } // Assert if (exist) { Assert.NotNull(response); Assert.IsType <ErgodoxLayout>(response); Assert.NotNull(response.Revision); Assert.False(string.IsNullOrWhiteSpace(response.HashId)); Assert.False(string.IsNullOrWhiteSpace(response.Title)); } }
public async Task GetErgodoxLayout_HashIdNull() { // Arrange ILayoutService layoutService = new LayoutService(); // Act await Assert.ThrowsAsync <ArgumentNullException>(() => layoutService.GetErgodoxLayout("", "", "")); }