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); }
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); }
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); }
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); }
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); }