public void GetHeaderRow_ThrowsExcption_WhenNotHeaderRow() { // Arrange var enrollmentRows = fixture.Create <List <string> >(); var headers = new List <string>(); var expectedMessage = "Fist row of CSV file must contain vaild headers."; _csvServiceMock.Setup(s => s.GetAssumedHeaderRow(It.IsAny <List <string> >())).Returns(headers); _csvServiceMock.Setup(s => s.IsHeaderRow(It.IsAny <List <string> >())).Returns(false); // Act // Assert var exception = Assert.Throws <ArgumentException>(() => _sut.GetHeaderRow(enrollmentRows)); Assert.AreEqual(expectedMessage, exception.Message); }