public void FacadePutToModelMapsCorrectly()
        {
            var post = new F.TopicPut
            {
                Description = _description,
                GroupId = _groupId.ToFacade(),
                Name = _name
            };

            var model = post.ToModel();

            Assert.That(model.Description, Is.EqualTo(post.Description));
            Assert.That(model.GroupId, Is.EqualTo(post.GroupId.ToModel()));
            Assert.That(model.Name, Is.EqualTo(post.Name));
        }
Exemple #2
0
        public void FacadePutToModelMapsCorrectly()
        {
            var post = new F.TopicPut
            {
                Description = _description,
                GroupId     = _groupId.ToFacade(),
                Name        = _name
            };

            var model = post.ToModel();

            Assert.That(model.Description, Is.EqualTo(post.Description));
            Assert.That(model.GroupId, Is.EqualTo(post.GroupId.ToModel()));
            Assert.That(model.Name, Is.EqualTo(post.Name));
        }
Exemple #3
0
        public void Should_put_a_topic()
        {
            var topicPut = new F.TopicPut()
            {
                Id          = F.Identity.Random(),
                Description = "description",
                GroupId     = F.Identity.Random(),
                Name        = "test"
            };

            mockedUpdateCommand.Setup(r => r.Execute(It.IsAny <M.Topic>()));

            client.ExecutePut(topicPut.Id.ToString(), topicPut);

            mockedUpdateCommand.Verify(r => r.Execute(It.Is <M.Topic>(t => t != null)));
            mockedUpdateCommand.Verify(r => r.Execute(It.Is <M.Topic>(t => t.Description == topicPut.Description)));
            mockedUpdateCommand.Verify(r => r.Execute(It.Is <M.Topic>(t => t.Name == topicPut.Name)));
            mockedUpdateCommand.Verify(r => r.Execute(It.Is <M.Topic>(t => t.GroupId == topicPut.GroupId.ToModel())));
        }
Exemple #4
0
        public void Should_put_a_topic()
        {
            var topicPut = new F.TopicPut()
            {
                Id = F.Identity.Random(),
                Description = "description",
                GroupId = F.Identity.Random(),
                Name = "test"
            };

            mockedUpdateCommand.Setup(r => r.Execute(It.IsAny<M.Topic>()));

            client.ExecutePut(topicPut.Id.ToString(), topicPut);

            mockedUpdateCommand.Verify(r => r.Execute(It.Is<M.Topic>(t => t != null)));
            mockedUpdateCommand.Verify(r => r.Execute(It.Is<M.Topic>(t => t.Description == topicPut.Description)));
            mockedUpdateCommand.Verify(r => r.Execute(It.Is<M.Topic>(t => t.Name == topicPut.Name)));
            mockedUpdateCommand.Verify(r => r.Execute(It.Is<M.Topic>(t => t.GroupId == topicPut.GroupId.ToModel())));
        }