Пример #1
0
        public void Effort_NetworkLog_GetByPrimaryKey_Test()
        {
            long           _id  = _incidentLogId;
            NetworkLogData _row = _sut.GetByPrimaryKey(_id);

            Assert.IsNotNull(_row);
            Assert.AreEqual(_row.NetworkLogId, _id);
            System.Diagnostics.Debug.WriteLine(_row.ToString());
        }
        public void WebSrv_NI_NetworkLog_GetByPrimaryKey_Test()
        {
            long             _id  = 39;
            NetworkLogAccess _sut = new NetworkLogAccess(_niEntities);
            NetworkLogData   _row = _sut.GetByPrimaryKey(_id);

            Assert.IsNotNull(_row);
            Assert.AreEqual(_row.NetworkLogId, _id);
            System.Diagnostics.Debug.WriteLine(_row.ToString());
        }
Пример #3
0
        public void Effort_NetworkLog_Delete_Test()
        {
            long _id        = _incidentLogId;
            int  _actualCnt = _sut.DeleteSave(_id);

            Assert.AreEqual(1, _actualCnt);
            NetworkLogData _row = _sut.GetByPrimaryKey(_id);

            Assert.IsNull(_row);
        }
Пример #4
0
        public void Effort_NetworkLog_Insert_Test()
        {
            int            _before = _niEntities.NetworkLogs.Count();
            DateTime       _idt    = new DateTime(2016, 4, 21, 12, 12, 12);
            NetworkLogData _row    = new NetworkLogData()
            {
                ServerId              = 1,
                IncidentId            = 3, IPAddress = "127.0.0.1", NetworkLogDate = _idt,
                Log                   = "Logs", IncidentTypeId = 1,
                IncidentTypeShortDesc = "SQL", Selected = true, IsChanged = true
            };
            int _actualCnt = _sut.InsertSave(_row);

            Assert.AreEqual(1, _actualCnt);
            int _after = _niEntities.NetworkLogs.Count();

            Assert.AreEqual(_before + 1, _after);
        }
Пример #5
0
        public void Effort_NetworkLog_Update_Test()
        {
            // only IncidentId
            long           _id         = _incidentLogId;
            int            _incidentId = 3;
            NetworkLogData _row        = _sut.GetByPrimaryKey(_id);

            _row.IncidentId = _incidentId;
            int _rowCnt = _sut.UpdateIncidentIdSave(_row);

            Assert.AreEqual(_rowCnt, 1);
            NetworkLogData _new = _sut.GetByPrimaryKey(_id);

            Console.WriteLine(_new.ToString());
            Assert.AreEqual(_row.IncidentId, _new.IncidentId);
            Assert.AreEqual(_row.IPAddress, _new.IPAddress);
            Assert.AreEqual(_row.NetworkLogDate, _new.NetworkLogDate);
            Assert.AreEqual(_row.Log, _new.Log);
            Assert.AreEqual(_row.IncidentTypeId, _new.IncidentTypeId);
        }