public void TestGraphRandom() { LinkedList <int> routerExpected = new LinkedList <int>(); routerExpected.AddLast(0); routerExpected.AddLast(1); routerExpected.AddLast(3); routerExpected.AddLast(4); MatrixAdjacency matrixIncidence = new MatrixAdjacency(5); int verticeStart = 0; int verticeEnd = 4; matrixIncidence.AddEdge(0, 2); matrixIncidence.AddEdge(0, 1); matrixIncidence.AddEdge(1, 3); matrixIncidence.AddEdge(3, 4); LinkedList <int> routerAtual = new Simplex(matrixIncidence).run(verticeStart, verticeEnd); string routerExpectedString = ConvertCollection <int> .ToString(routerExpected); string routerAtualString = ConvertCollection <int> .ToString(routerAtual); Assert.AreEqual(routerExpectedString, routerAtualString, null, "The routers no are equals"); }
public ManageParticipantsViewModel() { using (AppContext context = new AppContext()) { context.Participants.Load(); ConvertCollection convert = new ConvertCollection(); Participants = convert.GetParticipantModelFrom(context.Participants.Local); } }
public ManageItemsViewModel() { using (AppContext context = new AppContext()) { context.Items.Load(); ConvertCollection convert = new ConvertCollection(); Items = convert.GetItemModelFrom(context.Items.Local); } }
public RaffleWinnersViewModel(IUnitOfWork uow) { this.uow = uow; var raffles = uow.Raffles.GetAll() .Include(r => r.RaffleItems) .Include(r => r.RaffleParticipants) .Include(r => r.Winners) .ToObservableCollection(); var convert = new ConvertCollection(); Raffles = convert.GetRaffleModelFrom(raffles); }
public ManageRafflesViewModel(IUnitOfWork uow) { this.uow = uow; var raffles = uow.Raffles.GetAll() .Include(r => r.RaffleItems) .Include(r => r.RaffleParticipants) .Include(r => r.Winners) .ToObservableCollection(); var items = uow.Items.GetAll().ToObservableCollection(); var participants = uow.Participants.GetAll() .ToObservableCollection(); var convert = new ConvertCollection(); Raffles = convert.GetRaffleModelFrom(raffles); Items = convert.GetItemModelFrom(items); Participants = convert.GetParticipantModelFrom(participants); }