public void Property_Execute_ReturnsEmpty() { var command = new PropertyCommand(_helpContextService.Object, _console, LoggerMock.GetLogger <PropertyCommand>().Object); var resultMessage = command.Execute(); Assert.Equal("", resultMessage); }
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")); }
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); }
}// 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); }
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); }
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); }
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); }
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); }
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; }
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)); } }
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)); } }
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)); } }
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); }
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)); }
public void PropertyCommandConstructorTest() { var target = new PropertyCommand(new SsisTestSuite(Helper.CreateUnitTestStream(TestXmlFilename))); Assert.IsNotNull(target); }
public static void OnPropertyCommand(PropertyChangedEventArgs e) { PropertyCommand?.Invoke(null, e); }
public override bool VisitPropertyCommand(PropertyCommand command) { return(IndexUpdatesExtractor.visitPropertyCommand(command)); }