public void testgettag() { var context = CreateContext.getNewContext("TestingDB"); var repo = new TagRepo(context); var VC = new TagsController(repo); IEnumerable <Tags> Result = VC.GetTags(); string[] names = { "Loud", "Fun" }; int count = 0; foreach (Tags t in Result) { Assert.Equal(t.Tag, names[count]); count++; } }
private void ExecuteNewTagCommand() { var tag = new Tag { Name = NewTagName, Project = ProjectList.CurrentProject.Model, Color = NewTagColor.ToString(CultureInfo.InvariantCulture).Substring(3) }; TagRepo.Add(tag); ProjectList.AddTag(tag); Tags.Add(new TagViewModel(tag)); Reset(); MessengerInstance.Send(new TagAddedMessage(tag)); }
public AllRepos(string ConnectionString) { AddressRepo.SetInstance(ConnectionString); TraderRepo.SetInstance(ConnectionString); Repos.ItemRepo.SetInstance(ConnectionString); TagAssocRepo.SetInstance(ConnectionString); TagRepo.SetInstance(ConnectionString); TransactionRepo.SetInstance(ConnectionString); Address = AddressRepo.GetInstance(); Traders = TraderRepo.GetInstance(); Items = Repos.ItemRepo.GetInstance(); TagAssoc = TagAssocRepo.GetInstance(); Tags = TagRepo.GetInstance(); Transactions = TransactionRepo.GetInstance(); }
private async void ExecuteDeleteTagCommand(TagViewModel arg) { ConfirmationServiceArgs args = new ConfirmationServiceArgs(Strings.Confirm, string.Format(Strings.DoYouReallyWantToDeleteTagXXX, arg.Model.Name), Strings.Yes, Strings.No); if (!await ViewServices.Execute <IConfirmationService, bool>(args)) { return; } TagRepo.Delete(arg.Model); Tags.Remove(arg); MessengerInstance.Send(new TagRemovedMessage(arg.Model)); MessengerInstance.Send(new NotificationMessage(Strings.TagDeleted)); ReadTagNames(); }
private void ReadTagNames() { TagNames = TagRepo.GetAllNames(ProjectList.CurrentProject?.Model).ToList(); }