Example #1
0
        /// <inheritdoc />
        public object Clone()
        {
            var result = new IndexColumnDefinition {
                Name      = Name,
                Direction = Direction
            };

            AdditionalFeatures.CloneTo(result.AdditionalFeatures);
            return(result);
        }
Example #2
0
        /// <inheritdoc />
        public object Clone()
        {
            var result = new ConstraintDefinition(_constraintType)
            {
                Columns        = Columns,
                ConstraintName = ConstraintName,
                TableName      = TableName
            };

            AdditionalFeatures.CloneTo(result.AdditionalFeatures);
            return(result);
        }
Example #3
0
        public void SmartphonePlayMusicTest()
        {
            var smartphone = new Smartphone();
            var feature    = new AdditionalFeatures(smartphone);
            var device     = new Device(feature);

            var songTitle = "In The End.mp3";
            var action    = feature.PlayMusic(songTitle);

            var expected = "Playing In The End.mp3 ...";
            var actual   = device.PerformAction(action);

            Assert.Equal(expected, actual);
        }
Example #4
0
        public void SmartphoneAccessInternetTest()
        {
            var smartphone = new Smartphone();
            var feature    = new AdditionalFeatures(smartphone);
            var device     = new Device(feature);

            var url    = "www.google.com";
            var action = feature.AccessInternet(url);

            var expected = "Connecting to \"www.google.com\" ...";
            var actual   = device.PerformAction(action);

            Assert.Equal(expected, actual);
        }
Example #5
0
        public async Task <IActionResult> InsertFeatureConfirm(AdditionalFeaturesViewModel model)
        {
            ApplicationUser user = null;
            string          nvm;

            if (User.Identity.IsAuthenticated)
            {
                user = await userManager.FindByNameAsync(User.Identity.Name);

                model.UserId = user.Id;
            }
            if (!ModelState.IsValid)
            {
                nvm = NotificationHandler.SerializeMessage <string>(NotificationHandler.Wrong_Values, contentRootPath);
                return(RedirectToAction("InsertFeature", new { notification = nvm }));
            }
            try
            {
                AdditionalFeatures additionalFeatures = new AdditionalFeatures()
                {
                    Name        = model.Name,
                    LatinName   = model.LatinName,
                    Description = model.Description,
                    UserId      = model.UserId,
                    RegDateTime = DateTime.Now,
                    Status      = model.Status,
                };
                dbAdditionalFeatures.Insert(additionalFeatures);
                nvm = NotificationHandler.SerializeMessage <string>(NotificationHandler.Success_Insert, contentRootPath);
                return(RedirectToAction("InsertFeature", new { notification = nvm }));
            }
            catch (Exception)
            {
                nvm = NotificationHandler.SerializeMessage <string>(NotificationHandler.Failed_Operation, contentRootPath);
                return(RedirectToAction("InsertFeature", new { notification = nvm }));
            }
        }