예제 #1
0
        public void IfBuyerDontBelieveSellerHasArtefact_TransactionIsNotAccepted()
        {
            Interconnect(MyActor, OtherActor);
            var artefact = MyActor.CreateArtefact(Artefact.Name);

            OtherActor.CounterfeitArtefact(artefact);
            var key = StartTransaction(MyActor, OtherActor, artefact);

            Assert.NotNull(key);
            Assert.NotEmpty(key);
            Assert.False(OtherActor.AcceptTransaction(key));
        }
예제 #2
0
        public void WhenPeerDestroyArtefactThatPeerDoesntOwn_PeerLoosesTrust()
        {
            var artefact = MyActor.CreateArtefact(Artefact.Name);

            OtherActor.CounterfeitArtefact(artefact);
            Interconnect(MyActor, OtherActor);
            var trustBefore = MyAccount.GetTrust(OtherId);

            OtherActor.DestroyArtefact(artefact.Id);

            var expectedTrustAfter = trustBefore.Decrease(DestroyOthersArtefactDistrustFactor);

            Assert.Equal(expectedTrustAfter, MyAccount.GetTrust(OtherId));
        }