コード例 #1
0
        public void Property_Execute_ReturnsEmpty()
        {
            var command       = new PropertyCommand(_helpContextService.Object, _console, LoggerMock.GetLogger <PropertyCommand>().Object);
            var resultMessage = command.Execute();

            Assert.Equal("", resultMessage);
        }
コード例 #2
0
                public PropertyProvider(PropertyCommand <T, TProperty> parent, ITestMatcher <TProperty> real)
                {
                    _parent = parent;
                    _real   = real;

                    // Don't be reentrant with the cast provider type itself
                    Debug.Assert(!_real.GetType().Name.Contains("PropertyProvider"));
                }
コード例 #3
0
        protected void NewInOutLineMvoDocumentActionCommandAndExecute(ICreateInOutLineMvo c, IInOutLineMvoState s, IInOutLineMvoStateCreated e)
        {
            var pCommandHandler = this.InOutLineMvoDocumentActionCommandHandler;
            var pCmdContent     = c.DocumentAction;
            var pCmd            = new PropertyCommand <string, string> {
                Content = pCmdContent, GetState = () => s.InOutDocumentStatus, SetState = p => e.InOutDocumentStatus = p, OuterCommandType = CommandType.Create
            };

            pCommandHandler.Execute(pCmd);
        }
コード例 #4
0
ファイル: InOutAggregate.cs プロジェクト: 573000126/wms-4
        }// END Map(IRemove... ////////////////////////////

        protected void NewInOutDocumentActionCommandAndExecute(IMergePatchInOut c, IInOutState s, IInOutStateMergePatched e)
        {
            var pCommandHandler = this.InOutDocumentActionCommandHandler;
            var pCmdContent     = c.DocumentAction;
            var pCmd            = new PropertyCommand <DocumentAction, string> {
                Content = pCmdContent, GetState = () => s.DocumentStatus, SetState = p => e.DocumentStatus = p, OuterCommandType = CommandType.MergePatch
            };

            pCommandHandler.Execute(pCmd);
        }
コード例 #5
0
ファイル: OrderAggregate.cs プロジェクト: windygu/wms-2
        protected virtual void DoOrderShipGroupAction(string shipGroupSeqId, string value, Action <string> setOrderShipGroupStatusId)
        {
            var pCommandHandler = this.OrderShipGroupOrderShipGroupActionCommandHandler;
            var pCmdContent     = value;
            var pCmd            = new PropertyCommand <string, string> {
                Content = pCmdContent, GetState = () => this.State.OrderShipGroups.Get(shipGroupSeqId).OrderShipGroupStatusId, SetState = setOrderShipGroupStatusId, OuterCommandType = "OrderShipGroupAction"
            };

            pCmd.Context = this.State;
            pCommandHandler.Execute(pCmd);
        }
コード例 #6
0
ファイル: OrderAggregate.cs プロジェクト: windygu/wms-2
        protected void NewOrderShipGroupOrderShipGroupActionCommandAndExecute(ICreateOrderShipGroup c, IOrderShipGroupState s, IOrderShipGroupStateCreated e)
        {
            var pCommandHandler = this.OrderShipGroupOrderShipGroupActionCommandHandler;
            var pCmdContent     = default(string);
            var pCmd            = new PropertyCommand <string, string> {
                Content = pCmdContent, GetState = () => s.OrderShipGroupStatusId, SetState = p => e.OrderShipGroupStatusId = p, OuterCommandType = CommandType.Create
            };

            pCmd.Context = this.State;
            pCommandHandler.Execute(pCmd);
        }
コード例 #7
0
        protected virtual void DoDocumentAction(string value, Action <string> setDocumentStatusId)
        {
            var pCommandHandler = this.InOutDocumentActionCommandHandler;
            var pCmdContent     = value;
            var pCmd            = new PropertyCommand <string, string> {
                Content = pCmdContent, GetState = () => this.State.DocumentStatusId, SetState = setDocumentStatusId, OuterCommandType = "DocumentAction"
            };

            pCmd.Context = this.State;
            pCommandHandler.Execute(pCmd);
        }
コード例 #8
0
        protected void NewInOutDocumentActionCommandAndExecute(ICreateInOut c, IInOutState s, IInOutStateCreated e)
        {
            var pCommandHandler = this.InOutDocumentActionCommandHandler;
            var pCmdContent     = default(string);
            var pCmd            = new PropertyCommand <string, string> {
                Content = pCmdContent, GetState = () => s.DocumentStatusId, SetState = p => e.DocumentStatusId = p, OuterCommandType = CommandType.Create
            };

            pCmd.Context = this.State;
            pCommandHandler.Execute(pCmd);
        }
コード例 #9
0
        private static void PopulateItemProperties(IdAndSession idAndSession, Item item, ModernAttachment outAttachment)
        {
            ItemType itemType = ItemType.CreateFromStoreObjectType(item.StoreObjectId.ObjectType);

            itemType.ItemClass        = item.ClassName;
            itemType.Subject          = (item[ItemSchema.Subject] as string);
            itemType.ItemId           = GetModernAttachmentsCommand.Utilities.GetItemId(idAndSession, item.Id);
            itemType.DateTimeCreated  = GetModernAttachmentsCommand.Utilities.FormatExDateTime(item.CreationTime);
            itemType.LastModifiedTime = GetModernAttachmentsCommand.Utilities.FormatExDateTime(item.LastModifiedTime);
            itemType.Size             = new int?((int)item.Size());
            ConversationId conversationId = PropertyCommand.GetPropertyValueFromStoreObject(item, ItemSchema.ConversationId) as ConversationId;
            string         id             = IdConverter.ConversationIdToEwsId(idAndSession.Session.MailboxGuid, conversationId);

            itemType.ConversationId = new ItemId(id, null);
            outAttachment.Data.Item = itemType;
        }
コード例 #10
0
 internal void RegisterAttributeVariableProp(PropertyInfo info, ConsoleVariableAttribute attr)
 {
     m_masterDictionary.TryGetValue(attr.name, out Command comm);
     if (comm != null)
     {
         Debug.LogError("Multiple Attribute Variables with the same name: " + attr.name + " , this is not allowed.");
         return;
     }
     else
     {
         PropertyCommand cmd = new PropertyCommand(attr.name, attr.description, this);
         cmd.Initialize(info);
         m_variableDictionary.Add(attr.name, cmd);
         m_masterDictionary.Add(attr.name, cmd);
         m_commandsTrie.Add(new TrieEntry <string>(attr.name, attr.name));
     }
 }
コード例 #11
0
        public async Task <IActionResult> Create([FromBody] PropertyCommand command)
        {
            try
            {
                var cm   = command.ToEntity();
                var user = await _userManager.FindByNameAsync(User.Identity.Name);

                cm.OwnerId = user.Id;
                await _repository.AddAsync(cm);

                await _uow.Commit();

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
コード例 #12
0
        public async Task <IActionResult> Update([FromBody] PropertyCommand command)
        {
            try
            {
                var cm       = command.ToEntity();
                var property = await _repository.GetByIdAsync(cm.Id);

                if (property != null)
                {
                    property.Title        = cm.Title;
                    property.Active       = cm.Active;
                    property.Description  = cm.Description;
                    property.State        = cm.State;
                    property.City         = cm.City;
                    property.Neighborhood = cm.Neighborhood;
                    property.Street       = cm.Street;
                    property.Number       = cm.Number;
                    property.Cep          = cm.Cep;
                    property.Complement   = cm.Complement;

                    await _repository.UpdateAsync(property);

                    await _uow.Commit();

                    return(Ok());
                }
                else
                {
                    return(NotFound("Imóvel não encontrado."));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
コード例 #13
0
        public override bool VisitPropertyCommand(PropertyCommand command)
        {
            PropertyStore propertyStore = _neoStores.PropertyStore;

            Track(propertyStore, command);
            foreach (PropertyBlock block in command.After)
            {
                switch (block.Type)
                {
                case STRING:
                    Track(propertyStore.StringStore, block.ValueRecords);
                    break;

                case ARRAY:
                    Track(propertyStore.ArrayStore, block.ValueRecords);
                    break;

                default:
                    // Not needed, no dynamic records then
                    break;
                }
            }
            return(false);
        }
コード例 #14
0
        public void TestMethod()
        {
            var        testSuite    = new SsisTestSuite();
            var        projectPath  = config.ProjectPath;
            var        template     = "Product.dtsx";
            var        templatePath = config.TemplatePath;
            PackageRef p            = new PackageRef("ProductPackage", projectPath, template, SsisUnit.Enums.PackageStorageType.FileSystem);

            var conn = new System.Data.SqlClient.SqlConnectionStringBuilder(config.ConnectionString);

            var DatabaseConnectionString = $"{ conn.ConnectionString};Provider=SQLNCLI11.1;Auto Translate=False;Integrated Security =SSPI;";

            ConnectionRef con1 = new ConnectionRef("Destination",
                                                   DatabaseConnectionString,
                                                   ConnectionRef.ConnectionTypeEnum.ConnectionString
                                                   );

            var originalProductListConnection = new PropertyCommand(testSuite)
            {
                Name         = "OriginalProductList",
                PropertyPath = @"\Package.Connections[OriginalProductList].Properties[ConnectionString]",
                Operation    = PropertyCommand.PropertyOperation.Set,
                Value        = config.OriginalFilePath
            };

            //var stagedProductListConnection = new PropertyCommand(testSuite)
            //{
            //    Name="StagedProductList",
            //    PropertyPath = @"\Package.Connections[StagedProductList].Properties[ConnectionString]",
            //    Operation =PropertyCommand.PropertyOperation.Set,
            //    Value= @"C:\Users\nishant-mishra\source\repos\SSIS_UnitTesting\temp\ProductList.txt"
            //};

            testSuite.SetupCommands.Commands.Add(originalProductListConnection);
            //testSuite.SetupCommands.Commands.Add(stagedProductListConnection);
            testSuite.ConnectionList.Add(con1.ReferenceName, con1);
            testSuite.PackageList.Add(p.Name, p);

            //VariableCommand var1 = new VariableCommand(testSuite)
            //{
            //    Name = "fileExists",
            //    Operation = VariableCommand.VariableOperation.Set,
            //    Value = "false"
            //};

            //testSuite.SetupCommands.Commands.Add(var1);

            Test test1 = new Test(testSuite, "Verify No of RecordsinTable", templatePath + template, null, "{74BF5B2C-1017-4015-8B4A-36EEEFD44C06}");

            testSuite.Tests.Add(test1.Name, test1);

            //SqlCommand command1 = new SqlCommand(testSuite, "Destination", false, "select count(1) from dbo.Product");

            //test1.TestSetup.Commands.Add(command1);

            var assert1 = new SsisAssert(testSuite, test1, "Assert: Product has records", 6, false)
            {
                Command = new SqlCommand(testSuite, "Destination", true, "select count(1) from dbo.Product;")
            };


            test1.Asserts.Add(assert1.Name, assert1);
            testSuite.Execute();

            Assert.AreEqual(2, testSuite.Statistics.GetStatistic(SsisUnitBase.Enums.StatisticEnum.AssertPassedCount));
        }
コード例 #15
0
        public void PropertyCommandConstructorTest()
        {
            var target = new PropertyCommand(new SsisTestSuite(Helper.CreateUnitTestStream(TestXmlFilename)));

            Assert.IsNotNull(target);
        }
コード例 #16
0
 public static void OnPropertyCommand(PropertyChangedEventArgs e)
 {
     PropertyCommand?.Invoke(null, e);
 }
コード例 #17
0
 public override bool VisitPropertyCommand(PropertyCommand command)
 {
     return(IndexUpdatesExtractor.visitPropertyCommand(command));
 }