Update() public method

public Update ( ) : void
return void
Example #1
0
        private void BtnSubmit_Click(object sender, EventArgs e)
        {
            s.ShopName     = txtShopName.Text;
            s.Phone        = txtShopPhone.Text;
            s.LicenseId    = txtLicensedNum.Text;
            s.DateLicensed = txtLIcensedDt.Text;
            s.DateRenewed  = txtRenewed.Text;
            s.Location     = txtlocation.Text;

            bool success = scontroller.Update(s);

            if (txtShopName.Text != "")
            {
                if (success == true)
                {
                    MessageBox.Show("Added successfully");
                    Dashboard admin = new Dashboard();
                    admin.ShowDialog();

                    this.Dispose();
                }
            }
            else
            {
                MessageBox.Show("Failed to add");
            }
        }
        public void SettingsControllerUpdateFailTest()
        {
            var settingsService    = MockHelperService.GetSettingsService(null);
            var settingsController = new SettingsController(new NLogLoggerFactory())
            {
                SettingsService = settingsService
            };
            var result = settingsController.Update(null);

            Assert.IsType(typeof(HttpNotFoundResult), result);
        }
        public void SettingsControllerUpdateDontThrowTest()
        {
            var settingsService    = MockHelperService.GetSettingsService(null);
            var settingsController = new SettingsController(new NLogLoggerFactory())
            {
                SettingsService = settingsService
            };
            var result = settingsController.Update(new ModuleSetting());

            Assert.Equal("RedirectToRouteResult",
                         result.GetType()
                         .Name);
        }
        public async void IsConfigurationUpdatedCorrectly()
        {
            var settings = new FullSettingsViewModel
            {
                Id               = DeviceId,
                AppName          = "EmbyStat",
                AutoUpdate       = false,
                KeepLogsCount    = 10,
                Language         = "en-US",
                MovieLibraries   = new List <string>(),
                ShowLibraries    = new List <string>(),
                ToShortMovie     = 10,
                UpdateInProgress = false,
                UpdateTrain      = 0,
                Username         = "******",
                WizardFinished   = true,
                MediaServer      = new FullSettingsViewModel.MediaServerSettingsViewModel
                {
                    ApiKey              = "1234567980",
                    ServerName          = "ServerName",
                    AuthorizationScheme = "MediaBrowser",
                    ServerAddress       = "localhost",
                    ServerPort          = 8097,
                    ServerProtocol      = 1,
                },
                Tvdb = new FullSettingsViewModel.TvdbSettingsViewModel
                {
                    LastUpdate = new DateTime(2019, 1, 1),
                    ApiKey     = "ABCDE"
                }
            };

            await _subject.Update(settings);

            _settingsServiceMock.Verify(x => x.SaveUserSettingsAsync(It.IsAny <UserSettings>()), Times.Once);
        }