Example #1
0
        public void GetAssetIdentificationInformation_WhenAssetIsValid_ReturnAssetName_Test()
        {
            // Arrange
            var expAsset = new Core.Models.Asset()
            {
                Id          = 1,
                AssetTypeId = 2,
                Name        = "Asset Name",
                IsActive    = true,
            };
            // var sut = _service;

            // Act
            var result = _service.GetAssetIdentificationInformation(expAsset);

            // Assert
            Assert.IsInstanceOf(typeof(string), result, "Result Type");
            Assert.IsNotNull(result, "Formatted Asset Name");
        }
Example #2
0
        public void GetAssetIdentificationInformation_WhenAssetTypeIsCreditCard_ReturnUpdatedAssetName_Test()
        {
            // Arrange
            var expAsset = new Core.Models.Asset()
            {
                Id          = 1,
                AssetTypeId = AssetTransactionServiceObjectMother.AssetTypeIdForCreditCard,
                Name        = "Asset Name",
                IsActive    = true,
            };
            var expSettingTypeId  = AssetTransactionServiceObjectMother.SettingTypeIdForAccountNumber;
            var _dataSettingTypes = new List <Core.Models.SettingType>()
            {
                new Core.Models.SettingType()
                {
                    Id       = expSettingTypeId,
                    IsActive = true,
                }
            };
            var _dataAssetSettings = new List <Core.Models.AssetSetting>()
            {
                new Core.Models.AssetSetting()
                {
                    Id            = 10,
                    AssetId       = expAsset.Id,
                    SettingTypeId = expSettingTypeId,
                    Value         = "1234",
                    IsActive      = true,
                }
            };

            _unitOfWork.AssetSettings = new InMemoryAssetSettingRepository(_dataAssetSettings);
            var expAssetName = expAsset.Name + " (1234)";

            _service = new AccountTransactionService(_unitOfWork);

            // Act
            var result = _service.GetAssetIdentificationInformation(expAsset);

            // Assert
            Assert.IsInstanceOf(typeof(string), result, "Result Type");
            Assert.AreEqual(expAssetName, result, "Asset Name");
        }