public void Reject_Fails_If_Called_By_None_Admin()
        {
            mContractState.Setup(x => x.Message).Returns(new Message(contractAddress, primaryAddress, 0));

            var contract = new AddressMapper(mContractState.Object, ownerAddress);

            Assert.Throws <SmartContractAssertException>(() => contract.Reject(secondaryAddress));
        }
        public void Reject_Fails_If_State_Is_Not_InPending_State(Status status)
        {
            state.SetStruct($"MappingInfo:{secondaryAddress}", new MappingInfo {
                Primary = primaryAddress, Status = (int)status
            });

            mContractState.Setup(x => x.Message).Returns(new Message(contractAddress, ownerAddress, 0));

            var contract = new AddressMapper(mContractState.Object, ownerAddress);

            Assert.Throws <SmartContractAssertException>(() => contract.Reject(secondaryAddress));
        }
        public void Reject_Rejects_Mapping()
        {
            state.SetStruct($"MappingInfo:{secondaryAddress}", new MappingInfo {
                Primary = primaryAddress, Status = (int)Status.Pending
            });

            mContractState.Setup(x => x.Message).Returns(new Message(contractAddress, ownerAddress, 0));

            var contract = new AddressMapper(mContractState.Object, ownerAddress);

            contract.Reject(secondaryAddress);

            Assert.Equal(default(MappingInfo), state.GetStruct <MappingInfo>($"MappingInfo:{secondaryAddress}"));
        }