Пример #1
0
        public void AccessLevelTwo()
        {
            // arrange
            _tester = new SecurityAccess((int)SecurityLevels.User);

            // act
            try
            {
                _tester.AccessLevelTwo();
            }
            catch (Exception ex)
            {
                Log.Fatal(ex);
                _tester.Passed = false;
            }

            // assert
            Assert.IsFalse(_tester.Passed);
        }
Пример #2
0
        public void AccessProperty()
        {
            // arrange
            var myFloat = 5.5F;

            _tester = new SecurityAccess((int)SecurityLevels.Guest);

            // act
            try
            {
                _tester.SomeFloat = myFloat;
            }
            catch (Exception ex)
            {
                Log.Fatal(ex);
            }

            // assert
            Assert.IsFalse(_tester.Passed);


            // arrange
            _tester = new SecurityAccess((int)SecurityLevels.Expert);

            // act
            try
            {
                _tester.SomeFloat = myFloat;
            }
            catch (Exception ex)
            {
                Log.Fatal(ex);
            }

            // assert
            Assert.IsTrue(_tester.Passed);
            Assert.AreEqual(myFloat, _tester.SomeFloat);
        }