示例#1
0
 public void CanCreate()
 {
     Assert.DoesNotThrow(() =>
     {
         IDataOperations testOperations = CreateOperationsInterface();
         testOperations.Create("LastName", "FirstName", gender: 'f', age: 34, grade: 12);
     },
                         "The create operation must be successful");
 }
示例#2
0
 public void CanUpdate()
 {
     Assert.DoesNotThrow(() =>
     {
         IDataOperations testOperations = CreateOperationsInterface();
         testOperations.Update(id: 1, "LastName", "FirstName", gender: 'm', age: 19, grade: 11);
     },
                         "The update operation must be successful");
 }
示例#3
0
 public void CanDelete()
 {
     Assert.DoesNotThrow(() =>
     {
         IDataOperations testOperations = CreateOperationsInterface();
         testOperations.Delete(id: 1);
     },
                         "The delete operation must be successful");
 }
        public void CanReadMapped()
        {
            Assert.DoesNotThrow(() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();
                Student student = testOperations.ReadMapped(id: 69);

                Assert.IsNotNull(student, "The Student returned must not be null");
            },
                                "The mapped read operation must be successful");
        }
        public void CanReadAllMapped()
        {
            Assert.DoesNotThrow(() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();
                IEnumerable <Student> students = testOperations.ReadAllMapped();

                Assert.IsNotNull(students, "The enumeration returned must not be null");
            },
                                "The mapped read all operation must be successful");
        }
示例#6
0
        public void CanRead()
        {
            Assert.DoesNotThrow(() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();
                DataSet dataSet = testOperations.Read();

                Assert.IsNotNull(dataSet, "The call must return a non-null DataSet");
            },
                                "The read operation must be successful");
        }
示例#7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            IDataOperations myData = GlobalConfig.Inject();

            IPagination paginator = GlobalConfig.InjectPaginator();

            MainWindow mw = new MainWindow(myData, paginator);

            mw.Show();
        }
        public void CanUpdateAsync()
        {
            Assert.DoesNotThrowAsync(async() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();

                Task task = testOperations.UpdateAsync(id: 1, "LastName", "FirstName", gender: 'm', age: 19, grade: 11);
                Assert.IsNotNull(task, "The Task returned must not be null");

                await task;
            },
                                     "The async update operation must be successful");
        }
        public void CanDeleteAsync()
        {
            Assert.DoesNotThrowAsync(async() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();

                Task task = testOperations.DeleteAsync(id: 35);
                Assert.IsNotNull(task, "The Task returned must not be null");

                await task;
            },
                                     "The async delete operation must be successful");
        }
        public void CanReadMappedAsync()
        {
            Assert.DoesNotThrowAsync(async() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();

                Task <Student> task = testOperations.ReadMappedAsync(id: 69);
                Assert.IsNotNull(task, "The Task returned must not be null");

                Student student = await task;
                Assert.IsNotNull(student, "The Student returned must not be null");
            },
                                     "The mapped read operation must be successful");
        }
        public void CanReadAllMappedAsync()
        {
            Assert.DoesNotThrowAsync(async() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();

                Task <IEnumerable <Student> > task = testOperations.ReadAllMappedAsync();
                Assert.IsNotNull(task, "The Task returned must not be null");

                IEnumerable <Student> students = await task;
                Assert.IsNotNull(students, "The enumeration returned must not be null");
            },
                                     "The mapped read all operation must be successful");
        }
        public void CanReadAllAsync()
        {
            Assert.DoesNotThrowAsync(async() =>
            {
                IDataOperations testOperations = CreateOperationsInterface();

                Task <DataSet> task = testOperations.ReadAllAsync();
                Assert.IsNotNull(task, "The Task returned must not be null");

                DataSet dataSet = await task;
                Assert.IsNotNull(dataSet, "The DataSet returned must not be null");
            },
                                     "The async read all operation must be successful");
        }
 public void CanCreateWithMappedParameters()
 {
     Assert.DoesNotThrow(() =>
     {
         IDataOperations testOperations = CreateOperationsInterface();
         testOperations.Create(new Student
         {
             FirstName = "CompoundTypeTest",
             LastName  = "LastName",
             Age       = 28,
             Gender    = "M",
             Grade     = 12
         });
     },
                         "The create operation with mapped parameters must be successful");
 }
 public void CanUpdateWithMappedParameters()
 {
     Assert.DoesNotThrow(() =>
     {
         IDataOperations testOperations = CreateOperationsInterface();
         testOperations.Update(id: 55, new Student
         {
             FirstName = "CompoundTypeTest - Updated",
             LastName  = "LastName - Updated",
             Age       = 29,
             Gender    = "F",
             Grade     = 11
         });
     },
                         "The update operation with mapped parameters must be successful");
 }
 public ApiDataController(ILogger <ApiDataController> logger, IDataOperations iDataOperations)
 {
     _iDataOperations = iDataOperations;
     _logger          = logger;
 }
示例#16
0
 public void SetDataMap(IDataOperations <TObject, TResult, TSearch> mappingInstance)
 {
     business.SetDataMap(mappingInstance);
 }
 public KeyValueStoreBusiness(IDataOperations <T> dataOperation)
 {
     this.dataOperation = dataOperation;
 }
示例#18
0
 public CreditCardPaymentFactory(IConfiguration configuration, IDataOperations dataOperations)
 {
     _configuration  = configuration;
     _dataOperations = dataOperations;
 }
示例#19
0
 public void SetDataMap(IDataOperations <TObject> dataOperatorInstance)
 {
     business.SetDataMap(dataOperatorInstance);
 }
示例#20
0
 public void SetDataMap(IDataOperations <TObject, TKey> mappingInstance)
 {
     business.SetDataMap(mappingInstance);
 }
示例#21
0
 public PaymentRepository(IDataOperations dataOperations, IPaymentFactory paymentFactory, ILogger <PaymentRepository> logger)
 {
     _dataOperations = dataOperations;
     _paymentFactory = paymentFactory;
     _logger         = logger;
 }
示例#22
0
 public void Setup()
 {
     _operations = GlobalConfig.Inject();
     _operations.LoadProductData();
     _operations.LoadCart();
 }
 public MessageRouter(ILogger logger, IDataOperations dataOperations, IMessageFilter filter)
 {
     _logger = logger;
     _dataOperations = dataOperations;
     _filter = filter;
 }
示例#24
0
 public CustomerRepository(IDataOperations dataOperations)
 {
     _dataOperations = dataOperations;
 }
示例#25
0
 public MainWindow(IDataOperations operations, IPagination paginator)
 {
     this.Operations = operations;
     this.Paginator  = paginator;
     InitializeComponent();
 }