public void BeEnumerable_With_NoInterfaces_Should_NotThrow() { // Arrange var actual = new EmptyEnumerable <int>(); // Act _ = actual.Must().BeEnumerableOf <int>(); // Assert }
public void BeEnumerable_With_WrongCurrent_Should_Throw() { // Arrange var actual = new EmptyEnumerable <int>(); // Act void action() => actual.Must().BeEnumerableOf <string>(); // Assert var exception = Assert.Throws <ActualAssertionException <EmptyEnumerable <int> > >(action); Assert.Equal(actual, exception.Actual); Assert.Equal($"Expected to be an enumerable of 'System.String' but found an enumerable of 'System.Int32'.{Environment.NewLine}Actual: {TestData.Empty.ToFriendlyString()}", exception.Message); }