コード例 #1
0
 public SupplierController(IStreinger streinger, SuppliersContext suppliersContext,
                           UserManager <User> userManager)
 {
     _streinger        = streinger;
     _suppliersContext = suppliersContext;
     _userManager      = userManager;
 }
コード例 #2
0
                public void SetUp()
                {
                    var goods = new Good[]
                    {
                        new Good()
                        {
                            Product = new Preparation()
                            {
                                Name = "hello_world"
                            },
                            Supplier = new Supplier()
                            {
                                Company = "company"
                            }
                        }
                    }.AsEnumerable();

                    var strngr = new Mock <IStreinger>();

                    strngr.Setup(ex => ex.Goods()).Returns(Task.FromResult(goods));
                    strngr.Setup(ex => ex.Goods(It.IsAny <string>())).Returns(Task.FromResult(goods));
                    strngr.Setup(ex => ex.Goods("NOT_EXISTS")).Returns(Task <IEnumerable <Good> > .FromResult((IEnumerable <Good>)null));

                    this.strngr = strngr.Object;
                }
コード例 #3
0
                public void SetUp()
                {
                    var strngr = new Mock <IStreinger>();

                    strngr.Setup(ex => ex.Goods()).Returns(Task.FromResult(new Good[] { new Good() }.AsEnumerable()));
                    strngr.Setup(ex => ex.Goods(It.IsAny <string>())).Returns(Task.FromResult(new Good[] { new Good() }.AsEnumerable()));
                    this.strngr = strngr.Object;
                }
コード例 #4
0
 public AdminController(UserManager <User> userManager,
                        RoleManager <IdentityRole> roleManager,
                        SuppliersContext suppliersContext,
                        MessengerContext messengerContext,
                        IStreinger streinger)
 {
     _streinger        = streinger;
     _userManager      = userManager;
     _messengerContext = messengerContext;
     _roleManager      = roleManager;
     _suppliersContext = suppliersContext;
 }
コード例 #5
0
 public SearchController(IStreinger streinger, ITopAlgorithm topAlgorithm)
 {
     this._streinger = streinger;
     _topAlgorithm   = topAlgorithm;
 }
コード例 #6
0
 public AjaxController(IStreinger streinger)
 {
     this._streinger = streinger;
 }
コード例 #7
0
 public Recommender(IStreinger streinger)
 {
     this._streinger = streinger;
 }
コード例 #8
0
 public ProductController(IStreinger streinger, IRecommender recommendator)
 {
     this._streinger     = streinger;
     this._recommendator = recommendator;
 }