public void GetClient_ShouldThrowArgumentNullException_WhenSkillRequestIsNotValid() { Mock <ISkillRequestValidator> mockSkillRequestValidator = new Mock <ISkillRequestValidator>(); mockSkillRequestValidator.Setup(x => x.IsValid(It.IsAny <SkillRequest>())).Returns(false); SkillProductsClientAdapter sut = new SkillProductsClientAdapter(mockSkillRequestValidator.Object); Assert.Throws <ArgumentNullException>(() => sut.GetClient(new SkillRequest())); }
public void GetClient_ShouldReturnInstanceOfISkillProductsClient_WhenSkillRequestIsValid() { Mock <ISkillRequestValidator> mockSkillRequestValidator = new Mock <ISkillRequestValidator>(); mockSkillRequestValidator.Setup(x => x.IsValid(It.IsAny <SkillRequest>())).Returns(true); SkillProductsClientAdapter sut = new SkillProductsClientAdapter(mockSkillRequestValidator.Object); ISkillProductsClient client = sut.GetClient(ValidSkillRequest); Assert.IsAssignableFrom <ISkillProductsClient>(client); }