Esempio n. 1
0
 public void GetDocumentTest404()
 {
     _tester.TestController()
     .Calling(c => c.GetDocument(_tester.TopicOne.Id))
     .ShouldReturn()
     .NotFound();
 }
Esempio n. 2
0
 public void GetTagFrequencyAnalyticsTest404()
 {
     _tester.TestController()
     .Calling(c => c.GetTagFrequencyAnalytics(_tester.TopicOne.Id))
     .ShouldReturn()
     .NotFound();
 }
Esempio n. 3
0
 public void GetReviewStatusTest404()
 {
     _tester.TestController()
     .Calling(c => c.GetReviewStatus(_tester.TopicOne.Id))
     .ShouldReturn()
     .NotFound();
 }
Esempio n. 4
0
 public void PostAttachmentTest404()
 {
     _tester.TestController()
     .Calling(c => c.PostAttachment(_tester.TopicOne.Id, AttachmentFormModel))
     .ShouldReturn()
     .StatusCode(404);
 }
        public void GetTest404()
        {
            var downloadHash = "abc";

            _tester.TestController()
            .Calling(c => c.Get(downloadHash))
            .ShouldReturn()
            .NotFound();
        }
 public void PostTopicTest()
 {
     _tester.TestController()
     .Calling(c => c.Post(TopicFormModel))
     .ShouldHave()
     .DbContext(db => db.WithSet <Topic>(topic => topic.Any(actual => actual.Title == TopicFormModel.Title)));
     // As we have problem with DI, when EmailService is invoked it returns BadRequest. Hence only a part of the positive test case is tested.
 }
 public void GetAllNotificationsTest200_Empty()
 {
     _tester.TestController(_tester.Supervisor.UId)
     .Calling(c => c.GetAllNotifications())
     .ShouldReturn()
     .Ok()
     .WithModelOfType <List <NotificationResult> >()
     .Passing(actual => actual.Count == 0);
 }
 /// <summary>
 /// Should return code 202 when an admin is trying to invite new users with new Emails
 /// </summary>
 //[Fact] - Dependency Injection is not working with XUnit as expected
 public void InviteUsersTest202()
 {
     _tester.TestController()
     .Calling(c => c.InviteUsers(InviteFormModel, null))
     .ShouldHave()
     .DbContext(db => db.WithSet <User>(newuser => newuser.Any(actual => actual.Email.Equals(InviteFormModel.Emails[0]))))
     .AndAlso()
     .ShouldReturn()
     .StatusCode(202);
 }
 public void GetUserTest200()
 {
     _tester.TestController()
     .Calling(c => c.Get(_tester.Admin.UId))
     .ShouldReturn()
     .Ok()
     .WithModelOfType <UserResult>()
     .Passing(m => m.Email == _tester.Admin.Email);
 }
Esempio n. 10
0
        public void GetLayerRelationRulesTest()
        {
            var myRelation = new LayerRelationRule()
            {
                SourceLayer   = _tester.Layer1,
                SourceLayerId = _tester.Layer1.Id,
                TargetLayer   = _tester.Layer2,
                TargetLayerId = _tester.Layer2.Id,
                Color         = "my-color",
                ArrowStyle    = "my-style",
                Title         = "my-title",
                Description   = "my-description"
            };
            var expected = new List <LayerRelationRule>()
            {
                myRelation
            };

            _tester.TestController()
            .WithDbContext(dbContext => dbContext
                           .WithSet <Layer>(db => db.AddRange(_tester.Layer1, _tester.Layer2))
                           .WithSet <LayerRelationRule>(db => db.Add(myRelation))
                           )
            .Calling(c => c.GetAllLayerRelationRules())
            .ShouldReturn()
            .Ok()
            .WithModelOfType <List <LayerRelationRule> >()
            .Passing(actual => expected.SequenceEqual(actual));
        }
 public void IsAllowedToCreateTagsTestOk()
 {
     _tester.TestController()
     .Calling(c => c.IsAllowedToCreateTags())
     .ShouldReturn()
     .Ok();
 }