public HomeController(VelemenyLogic Velemenylogic, KesLogic Keslogic, KesBoltLogic KesBoltlogic, NemCRUDLogic NonCrudLogic)
 {
     this.ReviewLogic     = Velemenylogic;
     this.KnifeLogic      = Keslogic;
     this.KnifeStoreLogic = KesBoltlogic;
     this.NonCrudLogic    = NonCrudLogic;
 }
        public void GetAllVelemeny()
        {
            Mock <IRepository <Velemeny> > MockoltRepo = new Mock <IRepository <Velemeny> >(MockBehavior.Loose);
            List <Velemeny> VelemenyTesztLista         = new List <Velemeny>()
            {
                new Velemeny()
                {
                    Szerzo = "Nick Shabazz", Elegedettseg = 8
                },
                new Velemeny()
                {
                    Szerzo = "Nagy Gábor", Elegedettseg = 2
                },
                new Velemeny()
                {
                    Szerzo = "Kss Ferenc", Elegedettseg = 3
                }
            };
            List <Velemeny> ElvartKimenet = new List <Velemeny>()
            {
                VelemenyTesztLista[0],
                VelemenyTesztLista[1],
                VelemenyTesztLista[2]
            };

            MockoltRepo.Setup(x => x.Read()).Returns(VelemenyTesztLista.AsQueryable());
            VelemenyLogic velemenyLogic = new VelemenyLogic(MockoltRepo.Object);
            var           Kimenet       = velemenyLogic.GetAllVelemeny();

            Assert.That(Kimenet, Is.EquivalentTo(ElvartKimenet));
            Assert.That(Kimenet.Count, Is.EqualTo(ElvartKimenet.Count));
        }
Beispiel #3
0
 public SampleDataGeneratorController(KesBoltLogic knifeStoreLogic, VelemenyLogic reviewLogic, KesLogic knifeLogic)
 {
     KnifeStoreLogic = knifeStoreLogic;
     ReviewLogic     = reviewLogic;
     KnifeLogic      = knifeLogic;
 }
 public ReviewController(VelemenyLogic reviewLogic)
 {
     this.reviewLogic = reviewLogic;
 }