Beispiel #1
0
 //[ExpectedException(typeof(ArgumentOutOfRangeException))]
 public void TestSafeEnum_Errors_3()
 {
     VoatAssert.Throws <ArgumentOutOfRangeException>(() => {
         var safeClass         = new TestEnumClass();
         safeClass.CommentSort = 203;
     });
 }
Beispiel #2
0
 //[ExpectedException(typeof(InvalidCastException))]
 public void Convert_Object_2()
 {
     VoatAssert.Throws <InvalidCastException>(() => {
         TestObject t       = new TestObject();
         TestObjectParent x = t.Convert <TestObjectParent, TestObject>();
     });
 }
Beispiel #3
0
 //[ExpectedException(typeof(ArgumentOutOfRangeException))]
 public void TestSafeEnum_Errors_2()
 {
     VoatAssert.Throws <ArgumentOutOfRangeException>(() => {
         var safeClass         = new TestEnumClass();
         safeClass.CommentSort = ((Domain.Models.CommentSortAlgorithm)(203));
     });
 }
Beispiel #4
0
 //[ExpectedException(typeof(TypeInitializationException))]
 public void TestSafeEnum_ConstructionError()
 {
     VoatAssert.Throws <TypeInitializationException>(() => {
         var s = new SomeStruct();
         SafeEnum <SomeStruct> x = new SafeEnum <SomeStruct>(s);
     });
 }
Beispiel #5
0
 public void UserData_ValidateUser_Constructor_5()
 {
     VoatAssert.Throws <VoatNotFoundException>(() => {
         string user  = "******";
         var voatData = new Domain.UserData(user, true);
     });
 }
Beispiel #6
0
 public void UserData_ValidateUser_Constructor_4()
 {
     VoatAssert.Throws <VoatNotFoundException>(() => {
         string user  = "******";
         var voatData = new Domain.UserData(user, true);
     });
 }
Beispiel #7
0
 public void UserData_ValidateUser_Constructor_3()
 {
     VoatAssert.Throws <ArgumentException>(() => {
         string user  = "******";
         var voatData = new Domain.UserData(user, true);
     });
 }
Beispiel #8
0
 public void UserData_ValidateUser_Constructor_2()
 {
     VoatAssert.Throws <ArgumentException>(() => {
         string user  = null;
         var voatData = new Domain.UserData(user, true);
     });
 }
Beispiel #9
0
 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;
     });
    
 }
Beispiel #10
0
        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"));
                }
            });
        }
Beispiel #11
0
 //[ExpectedException(typeof(TypeInitializationException))]
 public void TestSafeEnum_ConstructionError2()
 {
     VoatAssert.Throws <TypeInitializationException>(() => {
         SafeEnum <int> x = new SafeEnum <int>(45);
     });
 }