コード例 #1
0
        public void Update_PassCorrectPameters_ReturnTrue()
        {
            // Arrange
            var token     = "accessToken";
            var accountId = "Id";
            var account   = new SF_Account()
            {
                Id = accountId
            };
            var sfUtilities = new Mock <ISFUtilities>();

            sfUtilities.Setup(x => x.Update(It.IsAny <string>(), It.IsAny <SalesForceBase>(), It.IsAny <SFObject>(), It.IsAny <string>())).Returns(true);
            SalesForceBase.InitializeSFUtilities(sfUtilities.Object);

            // Act
            var result = SF_Account.Update(token, account);

            // Assert
            result.ShouldBeTrue();
            sfUtilities.Verify(
                x => x.Update(
                    It.Is <string>(t => t == token),
                    It.Is <SalesForceBase>(sf => sf == account),
                    It.Is <SFObject>(sf => sf == SFObject.Account),
                    It.Is <string>(id => id == accountId)),
                Times.Once);
        }
コード例 #2
0
        public void Insert_PassCorrectPameters_ReturnTrue()
        {
            // Arrange
            const string token       = "accessToken";
            var          account     = new SF_Account();
            var          sfUtilities = new Mock <ISFUtilities>();

            sfUtilities.Setup(x => x.Insert(token, account, SFObject.Account)).Returns(true);
            SalesForceBase.InitializeSFUtilities(sfUtilities.Object);

            // Act
            var result = SF_Account.Insert(token, account);

            // Assert
            result.ShouldBeTrue();
            sfUtilities.Verify(
                x => x.Insert(
                    It.Is <string>(t => t == token),
                    It.Is <SalesForceBase>(sf => sf == account),
                    It.Is <SFObject>(sf => sf == SFObject.Account)),
                Times.Once);
        }
コード例 #3
0
        public void Insert_PassCorrectPameters_ReturnTrue()
        {
            // Arrange
            var token       = "accessToken";
            var entity      = new SF_CampaignMemberStatus();
            var sfUtilities = new Mock <ISFUtilities>();

            sfUtilities.Setup(x => x.Insert(token, entity, SF_Utilities.SFObject.CampaignMemberStatus)).Returns(true);
            SalesForceBase.InitializeSFUtilities(sfUtilities.Object);

            // Act
            var result = SF_CampaignMemberStatus.Insert(token, entity);

            // Assert
            result.ShouldBeTrue();
            sfUtilities.Verify(
                x => x.Insert(
                    It.Is <string>(t => t == token),
                    It.Is <SalesForceBase>(sf => sf == entity),
                    It.Is <SF_Utilities.SFObject>(sf => sf == SF_Utilities.SFObject.CampaignMemberStatus)),
                Times.Once);
        }