//[ExpectedException(typeof(ArgumentOutOfRangeException))] public void TestSafeEnum_Errors_3() { VoatAssert.Throws <ArgumentOutOfRangeException>(() => { var safeClass = new TestEnumClass(); safeClass.CommentSort = 203; }); }
//[ExpectedException(typeof(InvalidCastException))] public void Convert_Object_2() { VoatAssert.Throws <InvalidCastException>(() => { TestObject t = new TestObject(); TestObjectParent x = t.Convert <TestObjectParent, TestObject>(); }); }
//[ExpectedException(typeof(ArgumentOutOfRangeException))] public void TestSafeEnum_Errors_2() { VoatAssert.Throws <ArgumentOutOfRangeException>(() => { var safeClass = new TestEnumClass(); safeClass.CommentSort = ((Domain.Models.CommentSortAlgorithm)(203)); }); }
//[ExpectedException(typeof(TypeInitializationException))] public void TestSafeEnum_ConstructionError() { VoatAssert.Throws <TypeInitializationException>(() => { var s = new SomeStruct(); SafeEnum <SomeStruct> x = new SafeEnum <SomeStruct>(s); }); }
public void UserData_ValidateUser_Constructor_5() { VoatAssert.Throws <VoatNotFoundException>(() => { string user = "******"; var voatData = new Domain.UserData(user, true); }); }
public void UserData_ValidateUser_Constructor_4() { VoatAssert.Throws <VoatNotFoundException>(() => { string user = "******"; var voatData = new Domain.UserData(user, true); }); }
public void UserData_ValidateUser_Constructor_3() { VoatAssert.Throws <ArgumentException>(() => { string user = "******"; var voatData = new Domain.UserData(user, true); }); }
public void UserData_ValidateUser_Constructor_2() { VoatAssert.Throws <ArgumentException>(() => { string user = null; var voatData = new Domain.UserData(user, true); }); }
public void InvalidVoteValue_Comment_Low() { VoatAssert.Throws<ArgumentOutOfRangeException>(() => { var user = TestHelper.SetPrincipal(USERNAMES.Unit); var cmd = new CommentVoteCommand(1, -2, IpHash.CreateHash("127.0.0.1")).SetUserContext(user); var c = cmd.Execute().Result; }); }
public void EnsureInvalidVoteValueThrowsException_Sub() { string userName = USERNAMES.User500CCP; var user = TestHelper.SetPrincipal(userName, null); //This user has one comment with 101 likes VoatAssert.Throws <ArgumentOutOfRangeException>(() => { using (var db = new Voat.Data.Repository(user)) { db.VoteSubmission(1, 21, IpHash.CreateHash("127.0.0.1")); } }); }
//[ExpectedException(typeof(TypeInitializationException))] public void TestSafeEnum_ConstructionError2() { VoatAssert.Throws <TypeInitializationException>(() => { SafeEnum <int> x = new SafeEnum <int>(45); }); }