Ejemplo n.º 1
0
            public void Should_find_a_group_by_Id()
            {
                var model = new MasterModel();

                var project1 = model.CreateProject(x => x.Name = "1");
                var group1_1 = project1.CreateGroup(x => x.Name = "1.1");
                var group1_2 = project1.CreateGroup(x => x.Name = "1.2");
                var group1_3 = project1.CreateGroup(x => x.Name = "1.3");

                var project2 = model.CreateProject(x => x.Name = "1");
                var group2_1 = project2.CreateGroup(x => x.Name = "2.1");
                var group2_2 = project2.CreateGroup(x => x.Name = "2.2");
                var group2_3 = project2.CreateGroup(x => x.Name = "2.3");

                var found = model.FindGroup(group2_2.Id);
            }
Ejemplo n.º 2
0
            public void Should_throw_an_exception_when_searching_for_a_group()
            {
                Exception thrown = null;

                var id = Guid.NewGuid();

                try
                {
                    _model.FindGroup(id);
                }
                catch (Exception e)
                {
                    thrown = e;
                }

                thrown.GetType().ShouldEqual(typeof(InvalidOperationException));
                thrown.Message.ShouldEqual(string.Format("Could not find group with id: {0}", id));
            }