Beispiel #1
0
 public ObjectManagerV1Tests(WorkspaceSetupFixture fixture, InstallApplicationSetupFixture installFixture)
 {
     _fixture        = fixture;
     _manager        = new ObjectManagerV1(_fixture.Helper.GetRestUrl(), new UsernamePasswordAuthentication(ConfigHelper.UserName, ConfigHelper.Password));
     _creation       = new DocumentCreationSetupFixture(fixture.Helper);
     _installFixture = installFixture;
     _creation.Create(_fixture.WorkspaceId, 1);
     _installFixture.Init(_fixture.WorkspaceId, ApplicationInstallContext.FieldTestPath);
 }
Beispiel #2
0
        public RSAPIObjectManagerTests(WorkspaceSetupFixture fixture, InstallApplicationSetupFixture installFixture)
        {
            _fixture        = fixture;
            _manager        = new RSAPIObjectManager(fixture.Helper);
            _creation       = new DocumentCreationSetupFixture(fixture.Helper);
            _installFixture = installFixture;

            _creation.Create(_fixture.WorkspaceId, 1);
            _installFixture.Init(_fixture.WorkspaceId, ApplicationInstallContext.FieldTestPath);
        }
Beispiel #3
0
        public async Task ReadAsync_SanityCheck()
        {
            //ARRANGE
            _creation.Create(_fixture.WorkspaceId, 1);

            //ACT
            var result = await _manager.ReadAsync(_fixture.WorkspaceId, new Interfaces.RelativityObject
            {
                ArtifactId = _creation.DocIds.Single()
            }, null);

            //ASSERT
            Assert.Equal(_creation.DocIds.Single(), result.ArtifactId);
        }
Beispiel #4
0
        public async Task ReadAsync_SanityCheck()
        {
            //ARRANGE
            _creation.Create(_fixture.WorkspaceId, 1);

            //ACT
            var result = await _manager.ReadAsync(_fixture.WorkspaceId, new Interfaces.RelativityObject
            {
                ArtifactId = _creation.DocIds.First()
            }, null);

            //ASSERT
            Assert.Equal(_creation.DocIds.Single(), result.ArtifactId);
            Assert.Contains(result.FieldValues, (f) => f.Field.Name.Equals("Artifact Id", StringComparison.CurrentCultureIgnoreCase));
            Assert.Equal(_creation.DocIds.Single(), result["Artifact Id"].ValueAsWholeNumber());
        }