Beispiel #1
0
        public void EditTest()
        {
            MonitoringController monitoringController;

            // 测试用例1
            monitoringController = new MonitoringController();
            monitoringController.Edit((Fire_ForestRemoteMonitoring)null);
            Assert.IsNotNull((object)monitoringController);
            Assert.AreEqual <string>("127.0.0.1", ((BaseService)monitoringController).Server);
            Assert.AreEqual <int>(8080, ((BaseService)monitoringController).Port);

            // 测试用例2
            monitoringController = new MonitoringController();
            Fire_ForestRemoteMonitoring s0 = new Fire_ForestRemoteMonitoring();

            s0.objectid      = 0;
            s0.name          = (string)null;
            s0.address       = (string)null;
            s0.manager       = (string)null;
            s0.phone         = (string)null;
            s0.longitude     = 0;
            s0.latitude      = 0;
            s0.county        = (string)null;
            s0.deviceid      = (string)null;
            s0.ip            = (string)null;
            s0.image         = (byte[])null;
            s0.height        = 0;
            s0.elevation     = 0;
            s0.h_offset      = 0;
            s0.v_offset      = 0;
            s0.cre_time      = (string)null;
            s0.cre_pers      = (string)null;
            s0.mod_time      = (string)null;
            s0.mod_pers      = (string)null;
            s0.shape         = (string)null;
            s0.user_         = (string)null;
            s0.password      = (string)null;
            s0.city          = (string)null;
            s0.channel       = 0;
            s0.Port          = 0;
            s0.picture1      = (string)null;
            s0.picture2      = (string)null;
            s0.video         = (string)null;
            s0.note          = (string)null;
            s0.username      = (string)null;
            s0.id            = (string)null;
            s0.pac           = (string)null;
            s0.mediaByteDict = (Dictionary <string, object>)null;
            s0.mediaFiles    = (List <MediaFile>)null;
            monitoringController.Edit(s0);
            Assert.IsNotNull((object)monitoringController);
            Assert.AreEqual <string>("127.0.0.1", ((BaseService)monitoringController).Server);
            Assert.AreEqual <int>(8080, ((BaseService)monitoringController).Port);
        }
        public void GET_Edit()
        {
            //Arrange
            var monitoring = new Monitoring
            {
                Id        = 123,
                PatientId = 321
            };

            _monitoringService.Setup(x => x.FindById(It.IsAny <int>())).Returns(monitoring);

            //Act
            var result = (ViewResult)_controller.Edit(1);

            //Assert
            Assert.That(result.ViewName, Is.Empty);
        }