public async Task IsValidLanguageAliasAsync_ReturnsFalseIfLanguageAliasIsNullOrWhitespace(string dummyLanguageAlias) { // Arrange using HighlightJSService testSubject = CreateHighlightJSService(); // Act bool result = await testSubject.IsValidLanguageAliasAsync(dummyLanguageAlias).ConfigureAwait(false); // Assert Assert.False(result); }
public async Task HighlightAsync_ReturnsCodeIfCodeIsEmptyOrWhitespace(string dummyCode) { // Arrange using HighlightJSService testSubject = CreateHighlightJSService(); // Act string?result = await testSubject.HighlightAsync(dummyCode, null !).ConfigureAwait(false); // Assert Assert.Equal(dummyCode, result); }
public async Task HighlightAsync_ThrowsArgumentNullExceptionIfCodeIsNull() { // Arrange using HighlightJSService testSubject = CreateHighlightJSService(); // Act and assert ArgumentNullException result = await Assert. ThrowsAsync <ArgumentNullException>(async() => await testSubject.HighlightAsync(null !, null !).ConfigureAwait(false)). ConfigureAwait(false); Assert.StartsWith(Strings.Exception_ParameterCannotBeNull, result.Message); }
public async Task HighlightAsync_ThrowsObjectDisposedExceptionIfInstanceHasBeenDisposed() { // Arrange HighlightJSService testSubject = CreateHighlightJSService(); testSubject.Dispose(); // Act and assert ObjectDisposedException result = await Assert. ThrowsAsync <ObjectDisposedException>(async() => await testSubject.HighlightAsync(null !, null !).ConfigureAwait(false)). ConfigureAwait(false); }
public async Task IsValidLanguageAliasAsync_ThrowsObjectDisposedExceptionIfInstanceHasBeenDisposed() { // Arrange HighlightJSService testSubject = CreateHighlightJSService(); testSubject.Dispose(); // Act and assert ObjectDisposedException result = await Assert. ThrowsAsync <ObjectDisposedException>(async() => await testSubject.IsValidLanguageAliasAsync(null !, default(CancellationToken)).ConfigureAwait(false)). ConfigureAwait(false); }