public ChangeMonitorControllerTest()
 {
     _mockRepo   = new Mock <ITestdataRepository>();
     _hubContext = new Mock <IHubContext <NotificationHub> >();
     _controller = new CRUDController(_mockRepo.Object, null, _hubContext.Object);
     //_hubContext = new HubContext();
 }
示例#2
0
 public EditWindow()
 {
     InitializeComponent();
     controller     = new CRUDController();
     bassController = new BassController();
     DataContext    = bassController;
 }
示例#3
0
        public void TestInitialize()
        {
            IDbSet <People> people = MockDBHelper.GetMockDbSet(this.CreatePeople());

            controller         = MockRepository.GeneratePartialMock <CRUDController>();
            controller.Request = new HttpRequestMessage(HttpMethod.Post, "http://localhost:21969/api/");
            controller.Expect(c => c.GetResultResponse(null)).IgnoreArguments().Return(new HttpResponseMessage()
            {
                StatusCode = System.Net.HttpStatusCode.OK
            });
        }
示例#4
0
        public void CheckCRUDCreate()
        {
            // Arrange
            CRUDController controller = new CRUDController(_mockRepo.Object, _logger, _hubContext.Object);
            // Act
            Testdata testdata = new Testdata()
            {
                Title = "Teszt cím", Value = "Teszt érték"
            };
            var result = controller.Create(0, testdata);

            // Assert
            Assert.NotNull(result);
        }
        public void ItemCanBeAdded()
        {
            var controller = new CRUDController<Promotion>(b);
            controller.Add(new Promotion
            {
                Expiration = DateTime.Now,
                PromotionCode = "",
                PromoType = Promotion.PromotionType.FlatRate,
                PromotionName = "5 off",
                PromoValue = 5
            });

            controller.ListAll().Count().ShouldEqual(1);
        }
        public void ItemCanBeAdded()
        {
            var controller = new CRUDController <Promotion>(b);

            controller.Add(new Promotion
            {
                Expiration    = DateTime.Now,
                PromotionCode = "",
                PromoType     = Promotion.PromotionType.FlatRate,
                PromotionName = "5 off",
                PromoValue    = 5
            });

            controller.ListAll().Count().ShouldEqual(1);
        }
示例#7
0
 public TestClassForCRUDController()
 {
     testController = new CRUDController(fakeBlogService);
     listBlogs      = new List <BlogPost>()
     {
         new BlogPost {
             Id = 1, Title = "Title1", Content = "Content1"
         },
         new BlogPost {
             Id = 2, Title = "Title2", Content = "Content2"
         },
         new BlogPost {
             Id = 3, Title = "Title3", Content = "Content3"
         },
         new BlogPost {
             Id = 4, Title = "Title4", Content = "Content4"
         },
     };
 }
 public void Initialize()
 {
     _moqDataBase = new Mock <IUnitofWork>();
     controller   = new CRUDController(_moqDataBase.Object);
     Mapper.Initialize(c => c.AddProfile <MappingProfile>());
     provider = new CustomerRoleProvider();
     ListLot  = new List <Lot>
     {
         new Lot
         {
             LotId           = 1,
             LotName         = "Audi",
             LotImageUrl     = "",
             StarLotSaleDate = DateTime.Today,
             EndLotSaleDate  = DateTime.Today,
             StartLotPrice   = 10,
             CurrentPrice    = 14,
             IsSold          = false
         },
         new Lot
         {
             LotId           = 2,
             LotName         = "WV",
             LotImageUrl     = "",
             StarLotSaleDate = DateTime.Today,
             EndLotSaleDate  = DateTime.Today,
             StartLotPrice   = 20,
             CurrentPrice    = 27,
             IsSold          = true
         },
         new Lot
         {
             LotId           = 7,
             LotName         = "BMW",
             LotImageUrl     = "",
             StarLotSaleDate = DateTime.Today,
             EndLotSaleDate  = DateTime.Today,
             StartLotPrice   = 50,
             CurrentPrice    = 54,
             IsSold          = false
         }
     };
 }
示例#9
0
        public void SetChildControllers(CRUDController controller)
        {
            Type  persistentType = controller.BusinessLogic.PersistentType;
            DBase db             = controller.BusinessLogic.DBConnection;

            if (persistentType == typeof(Comprobantes))
            {
                controller.AddChildController(CRUDControllerManager.Instance.GetCRUDController(db, typeof(DetallesComprobantesBL), typeof(DetallesComprobantesCRUD), "DetallesComprobantes"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(ClientesBL), typeof(ClientesCRUD), "Seleccionar Cliente", "Clientes"));
            }
            if (persistentType == typeof(ComprobantesCompras))
            {
                controller.AddChildController(CRUDControllerManager.Instance.GetCRUDController(db, typeof(DetallesComprobantesComprasBL), typeof(DetallesComprobantesComprasCRUD), "Detalles Comprobantes"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(TiposContribuyentesBL), typeof(TiposContribuyentesCRUD), "Seleccionar Tipo Contribuyente", "Tipos de Contribuyentes"));
            }
            if (persistentType == typeof(Clientes))
            {
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(ClasesBL), typeof(IdDescripcionCRUD), "Seleccionar Clase", "Clases"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(TiposContribuyentesBL), typeof(TiposContribuyentesCRUD), "Seleccionar Tipo Contribuyente", "Tipos de Contribuyentes"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(TiposPagoBL), typeof(IdDescripcionCRUD), "Seleccionar Tipo de Pago", "Tipos de Pago"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(ProvinciasBL), typeof(IdDescripcionCRUD), "Seleccionar Provincia", "Provincias"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(PaisesBL), typeof(IdDescripcionCRUD), "Seleccionar Paises", "Paises"));
            }
            if (persistentType == typeof(Productos))
            {
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(ClasesBL), typeof(IdDescripcionCRUD), "Seleccionar Clase", "Clases"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(RubrosBL), typeof(IdDescripcionCRUD), "Seleccionar Rubro", "Rubros"));
            }
            if (persistentType == typeof(DetallesComprobantes))
            {
                //controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(ProductosBL), typeof(ProductosCRUD), "Seleccionar Producto", "Productos"));
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(ProductosParaClienteBL), typeof(ProductosCRUD), "Seleccionar Producto", "Productos"));
            }
            if (persistentType == typeof(Empresas))
            {
                controller.AddSelController(CRUDControllerManager.Instance.GetCRUDSelController(db, typeof(TiposContribuyentesBL), typeof(TiposContribuyentesCRUD), "Seleccionar Tipo Contribuyente", "Clases"));
            }
        }
 public void StartsEmpty()
 {
     var controller = new CRUDController<Promotion>(b);
     controller.ListAll().ShouldBeEmpty();
 }
        public void StartsEmpty()
        {
            var controller = new CRUDController <Promotion>(b);

            controller.ListAll().ShouldBeEmpty();
        }