Пример #1
0
        public void GetByIdTest()
        {
            bool test = false;
            try {
                Test();

                var memberCtr = new MemberDb(_mockContext.Object);

                var mem = memberCtr.GetById(1);

                test = true;

                memberCtr.GetById(1);

            } catch (NullReferenceException) {
                if (test)
                    Assert.IsTrue(true);

                if (!test)
                    Assert.Fail();
            } catch (Exception e) {
                e.DebugGetLine();
                Assert.Fail();
            }
        }
Пример #2
0
        public void GetAllTest()
        {
            try {
                Test();

                var memberCtr = new MemberDb(_mockContext.Object);

                var list = memberCtr.GetAll();

                if (list.Count > 1) {
                    Assert.IsTrue(true);
                } else {
                    Assert.Fail();
                }

            } catch (Exception e) {
                e.DebugGetLine();
                Assert.Fail();
            }
        }