public void TestCreateMarker_Success()
        {
            var expectedType = typeof(CreateMarkerResponseOk);
            var dataCount    = 5;

            //given a database with some markers
            var dummyData = _testUtilitiesImpl
                            .CreateDummyMarkerData(_markerService, dataCount, _createdDocuments[0], _createdUsers[0]);

            //when we create a valid marker
            var marker = _testUtilitiesImpl.GetMarkerData(_createdDocuments[0],
                                                          _createdUsers[0], EMarkerType.Ellipse);
            var request = new CreateMarkerRequest {
                Marker = marker
            };
            var result = _markerService.CreateMarker(request);

            //then we get a CreateMarkerResponseOk
            //and the id is not null or empty
            Assert.Multiple(() =>
            {
                Assert.That(result, Is.TypeOf(expectedType));
                Assert.That(((CreateMarkerResponseOk)result).Request.Marker.MarkerId, Is.Not.Null);
                Assert.That(((CreateMarkerResponseOk)result).Request.Marker.MarkerId, Is.Not.Empty);
            });

            dummyData.Add(((CreateMarkerResponseOk)result).Request.Marker.MarkerId);
            _testUtilitiesImpl.DestroyMarkersDummyData(_markerService, dummyData.ToArray());
        }
Example #2
0
        public void CreateMarkerTest()
        {
            CreateMarkerRequest request = new CreateMarkerRequest()
            {
                BackColor      = "black", DocID = "1", ForeColor = "red",
                MarkerLocation = new Location()
                {
                    PointX = 16, PointY = 16, RadiusX = 3, RadiusY = 1
                }, MarkerType = "Rectangle",
                UserID        = "*****@*****.**"
            };
            Response response = _service.CreateMarker(request).Result;

            Assert.IsInstanceOf(typeof(CreateMarkerResponseOK), response);
        }
Example #3
0
        public List <string> CreateDummyMarkerData(IMarkerService markerService, int dataCount, string docId, string docOwner)
        {
            var retval = new List <string>();

            for (int i = 0; i < dataCount; i++)
            {
                var marker  = GetMarkerData(docId, docOwner, EMarkerType.Ellipse);
                var request = new CreateMarkerRequest {
                    Marker = marker
                };
                var result = markerService.CreateMarker(request) as CreateMarkerResponseOk;
                retval.Add(result?.Request.Marker.MarkerId);
            }

            return(retval);
        }
 public Response CreateMarker([FromBody] MarkerContracts.DTO.Marker marker)
 {
     return(MarkerService.CreateMarker(marker));
 }
 public async Task <Response> CreateMarker(CreateMarkerRequest request)
 {
     return(await _markerService.CreateMarker(request));
 }
 public Response CreateMarker([FromBody] CreateMarkerRequest request)
 {
     return(_markerService.CreateMarker(request));
 }