Пример #1
0
        public async Task with_correct_searchRequestid_upload_employment_should_succed()
        {
            var employment = new EmploymentEntity()
            {
                BusinessOwner = "Business Owner",
                BusinessName  = "Business Name",
                Notes         = "notes",
                Date1         = new DateTime(2001, 1, 1),
                Date1Label    = "date1lable",
                Date2         = new DateTime(2005, 1, 1),
                Date2Label    = "date2lable",

                SearchRequest = new SSG_SearchRequest()
                {
                    SearchRequestId = testId
                },
                Person = new SSG_Person()
                {
                    PersonId = testPersonId
                }
            };

            var result = await _sut.CreateEmployment(employment, CancellationToken.None);

            Assert.AreEqual("Business Owner", result.BusinessOwner);
        }
Пример #2
0
        public async Task with_non_duplicated_person_CreateEmployment_should_return_new_SSG_Employment()
        {
            _odataClientMock.Setup(x => x.For <SSG_Employment>(null).Set(It.Is <EmploymentEntity>(x => x.AddressLine1 == "normal"))
                                   .InsertEntryAsync(It.IsAny <CancellationToken>()))
            .Returns(Task.FromResult(new SSG_Employment()
            {
                EmploymentId = _testEmploymentId
            })
                     );
            var employment = new EmploymentEntity()
            {
                AddressLine1 = "normal",
                Person       = new SSG_Person()
                {
                    IsDuplicated = false
                }
            };
            var result = await _sut.CreateEmployment(employment, CancellationToken.None);

            Assert.AreEqual(_testEmploymentId, result.EmploymentId);
        }