Exemplo n.º 1
0
        public void CreateMedicalVendorMedicalVendorUserReturnsUserWhenGivenValidUserEntity()
        {
            MedicalVendorMedicalVendorUser medicalVendorMedicalVendorUser = _medicalVendorMedicalVendorUserFactoryfactory.
                                                                            CreateMedicalVendorMedicalVendorUser(0, new UserEntity());

            Assert.IsNotNull(medicalVendorMedicalVendorUser);
        }
Exemplo n.º 2
0
        public void CreateMedicalVendorMedicalVendorUserReturnsUserWhenGivenValidRow()
        {
            var medicalVendorInvoiceItemRow = (MedicalVendorInvoiceItemRow) new MedicalVendorInvoiceItemTypedView().Rows.Add();

            MedicalVendorMedicalVendorUser medicalVendorMedicalVendorUser = _medicalVendorMedicalVendorUserFactoryfactory.
                                                                            CreateMedicalVendorMedicalVendorUser(medicalVendorInvoiceItemRow);

            Assert.IsNotNull(medicalVendorMedicalVendorUser);
        }
Exemplo n.º 3
0
        public void CreateMedicalVendorMedicalVendorUserMapsNameFieldsCorrectly()
        {
            var expectedName = new Name("Test", "Testly", "McTester");

            MedicalVendorMedicalVendorUser user = _medicalVendorMedicalVendorUserFactoryfactory.
                                                  CreateMedicalVendorMedicalVendorUser(0, expectedName.FirstName, expectedName.MiddleName, expectedName.LastName);

            Assert.AreEqual(expectedName.FullName, user.Name.FullName);
        }
Exemplo n.º 4
0
        public void CreateMedicalVendorMedicalVendorUserSetsIdToGivenId()
        {
            const long medicalVendorMedicalVendorUserId = 3;

            MedicalVendorMedicalVendorUser medicalVendorMedicalVendorUser = _medicalVendorMedicalVendorUserFactoryfactory.
                                                                            CreateMedicalVendorMedicalVendorUser(medicalVendorMedicalVendorUserId, string.Empty, string.Empty, string.Empty);

            Assert.AreEqual(medicalVendorMedicalVendorUserId, medicalVendorMedicalVendorUser.Id);
        }
Exemplo n.º 5
0
        public void CreateMedicalVendorMedicalVendorUserReturnsUser()
        {
            var medicalVendorMedicalVendorUserView = new MedicalVendorMedicalVendorUserTypedView();

            medicalVendorMedicalVendorUserView.Rows.Add();
            var medicalVendorMedicalVendorUserRow = (MedicalVendorMedicalVendorUserRow)medicalVendorMedicalVendorUserView.Rows[0];

            MedicalVendorMedicalVendorUser medicalVendorMedicalVendorUser = _medicalVendorMedicalVendorUserFactoryfactory.
                                                                            CreateMedicalVendorMedicalVendorUser(medicalVendorMedicalVendorUserRow);

            Assert.IsNotNull(medicalVendorMedicalVendorUser);
        }
Exemplo n.º 6
0
        public MedicalVendorMedicalVendorUserAggregate CreateMedicalVendorMedicalVendorUserAggregate
            (MedicalVendorMedicalVendorUser medicalVendorMedicalVendorUser,
            MedicalVendorMvuserEarningAndPayRateTypedView medicalVendorMedicalVendorUserEarningAndPayRateView,
            MedicalVendorMvuserPaymentTypedView medicalVendorMedicalVendorUserPaymentView)
        {
            if (medicalVendorMedicalVendorUser == null)
            {
                throw new ArgumentNullException("medicalVendorMedicalVendorUser");
            }
            if (medicalVendorMedicalVendorUserEarningAndPayRateView == null)
            {
                throw new ArgumentNullException("medicalVendorMedicalVendorUserEarningAndPayRateView");
            }
            if (medicalVendorMedicalVendorUserPaymentView == null)
            {
                throw new ArgumentNullException("medicalVendorMedicalVendorUserPaymentView");
            }
            int     numberOfEvaluations = 0;
            decimal payRate             = 0m;
            decimal totalEarnings       = 0m;
            decimal totalPayments       = 0m;

            if (medicalVendorMedicalVendorUserEarningAndPayRateView.Where(m =>
                                                                          m.OrganizationRoleUserId == medicalVendorMedicalVendorUser.Id).Count() > 0)
            {
                MedicalVendorMvuserEarningAndPayRateRow medicalVendorMVUserEarningAndPayRateRow =
                    medicalVendorMedicalVendorUserEarningAndPayRateView.Where(m =>
                                                                              m.OrganizationRoleUserId == medicalVendorMedicalVendorUser.Id).Single();

                numberOfEvaluations = medicalVendorMVUserEarningAndPayRateRow.NumberOfEvaluations;
                payRate             = medicalVendorMVUserEarningAndPayRateRow.OfferRate;
                totalEarnings       = medicalVendorMVUserEarningAndPayRateRow.AmountEarned;
            }
            if (medicalVendorMedicalVendorUserPaymentView.Where(m =>
                                                                m.OrganizationRoleUserId == medicalVendorMedicalVendorUser.Id).Count() > 0)
            {
                MedicalVendorMvuserPaymentRow medicalVendorMVUserPaymentRow = medicalVendorMedicalVendorUserPaymentView.
                                                                              Where(m => m.OrganizationRoleUserId == medicalVendorMedicalVendorUser.Id).Single();
                totalPayments = medicalVendorMVUserPaymentRow.AmountPaid;
            }
            return(new MedicalVendorMedicalVendorUserAggregate
            {
                MedicalVendorMedicalVendorUser = medicalVendorMedicalVendorUser,
                NumberOfEvaluations = numberOfEvaluations,
                PayRate = payRate,
                TotalEarnings = totalEarnings,
                TotalPayments = totalPayments,
            });
        }
        public void CreateMedicalVendorInvoiceItemSetsCustomerNameToMVMVUserFullName()
        {
            AddRowToMedicalVendorInvoiceItemTypedView();
            MedicalVendorInvoiceItemRow medicalVendorInvoiceItemRow = _medicalVendorInvoiceItemTypedView[0];
            var medicalVendorMedicalVendorUser = new MedicalVendorMedicalVendorUser {
                Name = new Name("F", "M", "L")
            };

            Expect.Call(_medicalVendorMedicalVendorUserFactory.CreateMedicalVendorMedicalVendorUser(medicalVendorInvoiceItemRow))
            .Return(medicalVendorMedicalVendorUser);

            _mocks.ReplayAll();
            MedicalVendorInvoiceItem medicalVendorInvoiceItem = _medicalVendorInvoiceItemFactory.
                                                                CreateMedicalVendorInvoiceItem(medicalVendorInvoiceItemRow);

            _mocks.VerifyAll();

            Assert.AreEqual(medicalVendorMedicalVendorUser.Name.FullName, medicalVendorInvoiceItem.CustomerName);
        }
Exemplo n.º 8
0
        public void CreateMedicalVendorMedicalVendorUserMapsRowPropertiesToUserProperties()
        {
            const long   medicalVendorMedicalVendorUserId = 1;
            const long   medicalVendorId           = 2;
            const string expectedMedicalVendorName = "MedicalVendorName";
            const string expectedRoleName          = "RoleName";
            var          expectedName = new Name("FirstName", "MiddleName", "LastName");
            var          medicalVendorMedicalVendorUserView = new MedicalVendorMedicalVendorUserTypedView();

            medicalVendorMedicalVendorUserView.Rows.Add(medicalVendorMedicalVendorUserId, medicalVendorId,
                                                        expectedMedicalVendorName, expectedRoleName, expectedName.FirstName, expectedName.MiddleName, expectedName.LastName);
            var medicalVendorMedicalVendorUserRow = (MedicalVendorMedicalVendorUserRow)medicalVendorMedicalVendorUserView.Rows[0];

            MedicalVendorMedicalVendorUser medicalVendorMedicalVendorUser = _medicalVendorMedicalVendorUserFactoryfactory.
                                                                            CreateMedicalVendorMedicalVendorUser(medicalVendorMedicalVendorUserRow);

            Assert.AreEqual(medicalVendorMedicalVendorUserId, medicalVendorMedicalVendorUser.Id);
            Assert.AreEqual(medicalVendorId, medicalVendorMedicalVendorUser.MedicalVendorId);
            Assert.AreEqual(expectedMedicalVendorName, medicalVendorMedicalVendorUser.MedicalVendorName);
            Assert.AreEqual(expectedRoleName, medicalVendorMedicalVendorUser.RoleName);
            Assert.AreEqual(expectedName.FirstName, medicalVendorMedicalVendorUser.Name.FirstName);
            Assert.AreEqual(expectedName.MiddleName, medicalVendorMedicalVendorUser.Name.MiddleName);
            Assert.AreEqual(expectedName.LastName, medicalVendorMedicalVendorUser.Name.LastName);
        }