示例#1
0
 /// <summary>
 /// CreateSubNote - creates a subscriber note (in Triad via Rosettian)
 /// </summary>
 /// <param name="subscriberId"></param>
 /// <param name="note"></param>
 public void CreateSubNote(string subscriberId, NoteDto note)
 {
     using (var client = new RosettianClient())
     {
         client.CreateSubNote(subscriberId, note, CurrentUser.AsUserDto());
     }
 }
示例#2
0
        public void CreateNotes_GetNotesFromTriad_Succeed_Test()
        {
            var loc = new LocationDto();
            var sub = new SubscriberDto();
            try
            {
                // new sub and loc data
                loc = DataHelper.NewLocationData();
                sub = DataHelper.NewSubscriberData();
                sub.Accounts.First().Location = loc;
                DataHelper.RestoreLocation1(loc, false);
                DataHelper.RestoreSubscriber1(sub, false);

                // set current subscriber
                CurrentSubscriber.SetInstance(sub);

                // create new note
                var newNote = new NoteDto
                {
                    NoteCode = "DEFAULT",
                    NoteText = "This new note is created from SIMPL integration test",
                    NoteType = NoteTypeDto.SubNote

                };
                var sh = new SubscriberHelper();
                sh.CreateSubNote(sub.ID, newNote);

                var criteria = new SearchServiceHistoryDto
                {
                    SubscriberId = sub.ID,
                    LocationId = loc.ID,
                    StartDate = DateTime.Now.AddDays(-1),
                    EndDate = DateTime.Now.AddDays(+1)
                };
                // call LoadLocation action method
                var result = NotesControllerForTests.LoadRosettianNotes(criteria);

                // validate response result is not null
                Assert.IsNotNull(result, "Notes object is null");
                Assert.IsTrue(result.Any(), "There are no notes in Triad system for the given search criteria");
                Assert.IsTrue(result.Any(x => x.Notes.Contains("This new note is created from SIMPL integration test")), "The newly created note doesn't exist");
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex is AssertFailedException, ex.ToString());
                throw;
            }
            finally
            {
                DataHelper.DeleteSubscriber(sub.ID);
                DataHelper.DeleteLocation(loc.ID);
            }
        }