public void TaggingServiceCanGetTagsByPostId()
	    {
		    //Setup
			const string postId = "1";
			var apiCaller = A.Fake<ITaggingApiCaller>();
			var taggingService = new TaggingService(apiCaller);
			A.CallTo(() => apiCaller
				.ApiGet<TagListResponse>(TaggingService.TAGS_ENDPOINT + TaggingService.BY_POST_ENDPOINT + postId + "/"))
					.Returns(new TagListResponse
				            {
					            Tags = new List<Tag> { new Tag { PostId = postId } }
				            });

		    //Execute
		    var tags = taggingService.GetTagsByPostId(postId);

		    //Verify
		    tags.ShouldNotBeNull();
		    tags.ShouldHaveCount(1);
		    foreach (var tag in tags)
		    {
			    tag.PostId.ShouldEqual(postId);
		    }

		    //Teardown
	    }
	    public void TaggingServiceCanInsertATag()
	    {
		    //Setup
			var tag = new Tag
				          {
					          PostId = "1"
							  , UserId = "1"
							  , Text = "Tag"
				          };
			var apiCaller = A.Fake<ITaggingApiCaller>();
			A.CallTo(apiCaller).WithReturnType<Tag>().Returns(new Tag
				                                               {
					                                               Id = 1
																   , Text = tag.Text
																   , PostId = tag.PostId
																   , UserId = tag.UserId
																   , TimeStamp = DateTime.Now
				                                               });
			var taggingService = new TaggingService(apiCaller);

			//Execute
			var createdTag = taggingService.AddTag(tag);

			//Verify
			createdTag.ShouldNotBeNull();
			createdTag.Id.ShouldNotBeNull();
			createdTag.TimeStamp.ShouldNotBeNull();

		    //Teardown
	    }
Exemple #3
0
 public DownloadViewModel(IViewModelFactory viewModelFactory, DialogManager dialogManager, SettingsService settingsService,
                          DownloadService downloadService, TaggingService taggingService)
 {
     _viewModelFactory = viewModelFactory;
     _dialogManager    = dialogManager;
     _settingsService  = settingsService;
     _downloadService  = downloadService;
     _taggingService   = taggingService;
 }
 public void Dispose()
 {
     if (TaggingService != null)
     {
         TaggingService.Dispose();
         TaggingService = null;
         GC.SuppressFinalize(this);
     }
 }
	    public void TaggingServiceCanDeleteATag()
	    {
			//Setup
			const int tagId = 1;
			var apiCaller = A.Fake<ITaggingApiCaller>();
			var taggingService = new TaggingService(apiCaller);
		    A.CallTo(() => apiCaller.ApiDelete<Tag>(TaggingService.TAGS_ENDPOINT + tagId + "/")).Returns(new Tag {Id = 1});

			//Execute
			var deletedTag = taggingService.DeleteTag(tagId);

			//Verify
			deletedTag.ShouldNotBeNull();

		    //Teardown
	    }
Exemple #6
0
        /// <summary>
        /// SCORM Engine Service constructor that takes a single configuration parameter
        /// </summary>
        /// <param name="config">The Configuration object to be used to configure the Scorm Engine Service client</param>
        public ScormEngineService(Configuration config)
        {
            System.Net.ServicePointManager.Expect100Continue = false;

            configuration       = config;
            courseService       = new CourseService(configuration, this);
            dispatchService     = new DispatchService(configuration, this);
            registrationService = new RegistrationService(configuration, this);
            taggingService      = new TaggingService(configuration, this);
            invitationService   = new InvitationService(configuration, this);
            lrsAccountService   = new LrsAccountService(configuration, this);
            uploadService       = new UploadService(configuration, this);
            ftpService          = new FtpService(configuration, this);
            exportService       = new ExportService(configuration, this);
            reportingService    = new ReportingService(configuration, this);
            debugService        = new DebugService(configuration, this);
        }
        /// <summary>
        /// SCORM Engine Service constructor that takes a single configuration parameter
        /// </summary>
        /// <param name="config">The Configuration object to be used to configure the Scorm Engine Service client</param>
        public ScormEngineService(Configuration config)
        {
            System.Net.ServicePointManager.Expect100Continue = false;

            configuration = config;
            courseService = new CourseService(configuration, this);
            dispatchService = new DispatchService(configuration, this);
            registrationService = new RegistrationService(configuration, this);
            taggingService = new TaggingService(configuration, this);
            invitationService = new InvitationService(configuration, this);
            lrsAccountService = new LrsAccountService(configuration, this);
            uploadService = new UploadService(configuration, this);
            ftpService = new FtpService(configuration, this);
            exportService = new ExportService(configuration, this);
            reportingService = new ReportingService(configuration, this);
            debugService = new DebugService(configuration, this);
        }