public void IfNotEnoughCredit_ShouldThrow_CreditException(double credit) { Mock <ISmsXmlRpcProxy> proxyMock = new Mock <ISmsXmlRpcProxy>(); proxyMock.Setup(proxy => proxy.GetCredit(It.IsAny <AuthDto>())).Returns(credit); SmsServiceSender smsSender = new SmsServiceSender("user", "password", "+39035970378", proxyMock.Object); Assert.Throws <SmsCreditException>(() => smsSender.Send(_messageProvideMock.Object, "3479686512")); }
public void TestSmsSend_OnTheRealService_WithWrongPermission_ShouldThrow() { SmsServiceSender smsSender = new SmsServiceSender("Ciao", "Ciao", "+39035970378"); Assert.Throws <XmlRpcFaultException>(() => smsSender.Send(_messageProvideMock.Object, "3479686512")); }
public void TestSmsSend(string destinationNumber) { SmsServiceSender smsSender = new SmsServiceSender("", "", "+39035970378"); Assert.DoesNotThrow(() => smsSender.Send(_messageProvideMock.Object, destinationNumber)); }