예제 #1
0
        public void ApplXp_FailInvalidUser()
        {
            //Arrange
            var user = new XpModel {
                UserName = string.Empty, Xp = 123456, IntegrationsProvider = IntegrationsProviderTypes.GitHub
            };

            //Act
            var response = _browser.Put("/api/tracking/", x => x.JsonBody(user));

            //Assert
            response.StatusCode.ShouldEqual(HttpStatusCode.BadRequest);
            // _xpTracking.Verify(x => x.ApplyTracking(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()), Times.Never);
        }
예제 #2
0
        public void ApplXp_FailApplyFailure()
        {
            //Arrange
            var user = new XpModel {
                UserName = "******", Xp = 123456, IntegrationsProvider = IntegrationsProviderTypes.GitHub
            };
            // _xpTracking.Setup(x => x.ApplyTracking(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>())).Returns(false);

            //Act
            var response = _browser.Put("/api/tracking/", x => x.JsonBody(user));

            //Assert
            response.StatusCode.ShouldEqual(HttpStatusCode.BadRequest);
            // _xpTracking.Verify(x => x.ApplyTracking(It.IsAny<string>(), It.IsAny<int>(), It.IsAny<int>()), Times.Once);
        }