예제 #1
0
        public void Ensure_returns_itself()
        {
            var request           = new GetTrackRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            var nextRequestObject = request.ForUser(Guid.NewGuid().ToString(), Guid.NewGuid().ToString());

            Assert.AreSame(request, nextRequestObject);
        }
예제 #2
0
        public void Check_pin_is_set()
        {
            var pin               = Guid.NewGuid().ToString();
            var request           = new GetTrackRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            var nextRequestObject = request.ForUser(Guid.NewGuid().ToString(), pin);

            Assert.AreEqual(pin, ((GetTrackRequest)nextRequestObject).Pin);
        }
예제 #3
0
        public void Check_username_is_set()
        {
            var username          = Guid.NewGuid().ToString();
            var request           = new GetTrackRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            var nextRequestObject = request.ForUser(username, Guid.NewGuid().ToString());

            Assert.AreEqual(username, ((GetTrackRequest)nextRequestObject).Username);
        }
예제 #4
0
        public void Throws_when_IUser_is_null()
        {
            var request = new GetTrackRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            var ex      = Assert.Throws <ArgumentNullException>(() =>
            {
                request.ForUser(null);
            });

            Assert.AreEqual("user", ex.ParamName);
        }
예제 #5
0
        public void Check_IUser_username_set_correctly()
        {
            var user = new Mock <IUser>();

            user.Setup(x => x.BuddyBeaconUsername).Returns(Guid.NewGuid().ToString());
            user.Setup(x => x.BuddyBeaconPin).Returns(Guid.NewGuid().ToString());
            var request           = new GetTrackRequest(Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            var nextRequestObject = request.ForUser(user.Object);

            Assert.AreEqual(user.Object.BuddyBeaconUsername, ((GetTrackRequest)nextRequestObject).Username);
        }