Assert an Exception using XUnit
I am a newbie to XUnit and Moq. I have a method which takes string as an argument.How to handle an exception using XUnit. [Fact] public void ProfileRepository_GetSettingsForUserIDWithInvalidArguments_ThrowsArgumentException() { //arrange ProfileRepository profiles = new ProfileRepository(); //act var result = profiles.GetSettingsForUserID(“”); //assert //The below statement is not working as expected. Assert.Throws<ArgumentException>(() => profiles.GetSettingsForUserID(“”)); } Method under … Read more