mercredi 1 avril 2015

C# Web Service Unit Tests

I have the following Entity:



Amount

Currency - String

Value - decimal


I have also a wcf service that uses this entity and I want to make a unit test to this class.


My problem is that I want test invalid values to the Value in the entity and if I try to assign in in the c#



Amout m = new Amout{Currency = "EUR", Value = "aaaa"}


gave error.


How can I test this situation?


For example I can make the following request in soapUI:



<itc1:Amount>
<itc2:Currency>EUR</itc2:Currency>
<itc2:Value>aaaaaa</itc2:Value>
</itc1:Amount>


and I get error from the service.


I want to make the same with an unit test.


I hope you can help me.


Aucun commentaire:

Enregistrer un commentaire