Example #1
0
        public void GetName()
        {
            MockProxy.DataBaseServiceMock _proxy = new MockProxy.DataBaseServiceMock();
            Person person = _proxy.GetName("1");

            if (person.ID != "1")
            {
                throw new Exception("");
            }
        }
Example #2
0
        public void GetTable()
        {
            MockProxy.DataBaseServiceMock _proxy = new MockProxy.DataBaseServiceMock();
            int count = _proxy.GetTable().Count;

            if (count != 6)
            {
                throw new Exception("");
            }
        }
Example #3
0
        public void AddName()
        {
            MockProxy.DataBaseServiceMock _proxy = new MockProxy.DataBaseServiceMock();
            int    countBefore = _proxy.GetTable().Count;
            string newName     = "ABC";

            _proxy.AddName(newName);
            int countAfter = _proxy.GetTable().Count;

            if (countBefore + 1 != countAfter)
            {
                throw new Exception("Invalid number");
            }

            if (_proxy.GetTable()[countBefore].Fullname != newName)
            {
                throw new Exception("Adding failed");
            }
        }
Example #4
0
        public void UpdateName()
        {
            MockProxy.DataBaseServiceMock _proxy = new MockProxy.DataBaseServiceMock();
            Person oldEntry    = _proxy.GetTable()[0];
            int    countBefore = _proxy.GetTable().Count;
            string newName     = "ABC";

            _proxy.ChangeName("1", newName);
            Person newEntry   = _proxy.GetTable()[0];
            int    countAfter = _proxy.GetTable().Count;

            if (newEntry.Fullname != newName)
            {
                throw new Exception("Wrong name");
            }
            if (countBefore != countAfter)
            {
                throw new Exception("Invalid number");
            }
        }
Example #5
0
 public void InitProxy()
 {
     MockProxy.DataBaseServiceMock _proxy = new MockProxy.DataBaseServiceMock();
 }