public static long HashAddress(string anAddress)
        {
            CheckArg.Address(anAddress);
            var hash = anAddress.GetHashCode();

            return(hash);
        }
Beispiel #2
0
        public void CheckArgReturnTest()
        {
            using (var stream = new MemoryStream())
            {
                CheckArg.Stream(stream);
            }

            try
            {
                CheckArg.Stream(null);
                Assert.Fail();
            }
            catch (ActorException)
            {
            }

            CheckArg.Address("My address");
            try
            {
                CheckArg.Address(string.Empty);
                Assert.Fail();
            }
            catch (ActorException)
            {
            }

            CheckArg.Behaviors(new Actor.Base.Behaviors());
            try
            {
                CheckArg.Behaviors(null);
                Assert.Fail();
            }
            catch (ActorException)
            {
            }

            CheckArg.Behavior(new Actor.Base.Behavior <string>());
            try
            {
                CheckArg.Behavior(null);
                Assert.Fail();
            }
            catch (ActorException)
            {
            }

            CheckArg.Actor(new Actor.Base.BaseActor());
            try
            {
                CheckArg.Actor(null);
                Assert.Fail();
            }
            catch (ActorException)
            {
            }
        }
Beispiel #3
0
 public RssReaderActor(string url, IActor target)
 {
     CheckArg.Address(url);
     Become(new Behavior <string, IActor>(DoSyndication));
     this.SendMessage(url, target);
 }