コード例 #1
0
        public void GetWitcher()
        {
            Mock <IRepository <Witcher> > mock4 = new Mock <IRepository <Witcher> >(MockBehavior.Loose);
            Witcher w2 = new Witcher {
                Name = "John", Age = 99, AvaragePay = 120, School = "School of the Bear"
            };

            string randomid = "random1234";

            mock4.Setup(x => x.Read(randomid)).Returns(w2);
            WitcherLogic wl = new WitcherLogic(mock4.Object);

            //---
            Witcher w3 = wl.Read(randomid);

            Assert.That(w3, Is.EqualTo(w2));
        }
コード例 #2
0
 public IActionResult UpdateWitcher(string id)
 {
     return(View(WitcherLogic.Read(id)));
 }
コード例 #3
0
 public Witcher GetWitcher(string uid)
 {
     return(logic.Read(uid));
 }