Ejemplo n.º 1
0
        public async Task Insert_Button_And_Find_And_Delete_Test()
        {
            var client = new HistoryMapWebClient(user, pass);
            var record = new GenericLabelForWorldMap(new LocalDate(Era.BeforeCommon, 50, 5, 5), new Point(5, 5),
                                                     "SomeType", new Dictionary <string, string>()
            {
                { "Key", "Value" }
            }, 50, 50, Guid.NewGuid().ToString());

            //create record
            var a = await client.CreateRecord(record);

            Assert.IsTrue(a.Success);

            //Find record
            var allRecords = await client.GetButtons();

            var inserted = allRecords.SingleOrDefault(p => p._id == record._id);

            Assert.IsNotNull(inserted);

            //Delete record
            var deleteResult = await client.Delete <GenericLabelForWorldMap>(record._id);

            Assert.IsTrue(deleteResult.Success);

            //Check deletion
            allRecords = await client.GetButtons();

            inserted = allRecords.SingleOrDefault(p => p._id == record._id);

            Assert.IsNull(inserted);
        }
Ejemplo n.º 2
0
        public async Task HistoryMapWebClientTest_AllButtons()
        {
            var client = new HistoryMapWebClient(user, pass);
            var btns   = await client.GetButtons();

            Assert.AreNotEqual(0, btns.Count);
        }
Ejemplo n.º 3
0
        public async Task HistoryMapWebClientTest_AllButtonsFilter()
        {
            const int expectedBtns = 1;
            var       startDate    = new LocalDate(Era.Common, 1065, 5, 5);
            var       endDate      = new LocalDate(Era.Common, 1067, 5, 5);
            var       client       = new HistoryMapWebClient(user, pass);
            var       btns         = await client.GetButtons(startDate, endDate);

            Assert.AreEqual(expectedBtns, btns.Count);
        }
Ejemplo n.º 4
0
        public async Task InsertandUpdate_Button_AD()
        {
            var client = new HistoryMapWebClient(user, pass);
            var record = new GenericLabelForWorldMap(new LocalDate(Era.BeforeCommon, 50, 5, 5), new Point(5, 5),
                                                     "SomeType", new Dictionary <string, string>()
            {
                { "Key", "Value" }
            }, 50, 50, Guid.NewGuid().ToString());

            //create record
            var a = await client.CreateRecord(record);

            Assert.IsTrue(a.Success);

            //Find record
            var allRecords = await client.GetButtons();

            var inserted = allRecords.SingleOrDefault(p => p._id == record._id);

            Assert.IsNotNull(inserted);

            //Update record
            var newDate = new LocalDate(Era.Common, 1050, 05, 05);

            record.timeOf = newDate;
            var updateResult = await client.UpdateRecord(record);

            Assert.IsTrue(updateResult.Success);

            //Check update
            allRecords = await client.GetButtons();

            inserted = allRecords.SingleOrDefault(p => p._id == record._id);

            Assert.AreEqual(newDate, inserted.timeOf);
        }