public void RequiredStringListWithValueTest() { var obj3 = new ObjWithRequiredList() { RequiredStringCollection = new List <string>() { "Test" } }; Assert.IsTrue(SwagValidator.Validate(obj3)); }
public void RequiredStringListWithOutValueTest() { try { var obj4 = new ObjWithRequiredList(); //empty string list test SwagValidator.Validate(obj4); //should throw exception Assert.Fail(); // should not reach here because empty string threw exception } catch (Exception ex) { Assert.AreEqual("Value cannot be null. Parameter name: RequiredStringCollection", ex.Message); } }