コード例 #1
0
        public void Author_will_be_assigned_to_a_stat_after_creating_one()
        {
            var author = new Author("Chris Missal");

            var stat = new Stat("title", "desc", author, DateTime.Now);

            Assert.Same(stat.Author, author);
        }
コード例 #2
0
        public Stat CreateStat(Author author, string title, string description)
        {
            Validate.NotEmpty(description, "description");
            Validate.NotEmpty(title, "title");

            var stat = new Stat(title, description, author, DateTime.Now);
            var key = Keyable.CreateKey(title);
            stat.SetKey(key);
            statRepository.SaveOrUpdate(stat);
            return stat;
        }
コード例 #3
0
        public void StatService_should_be_able_to_create_a_Stat()
        {
            var testStartTime = DateTime.Now;
            var author = new Author("Chris");
            const string description = "25% of cars go over 100mph.";

            var stat = GetService().CreateStat(author, "25% of", description);

            stat.ShouldNotBeNull();
            stat.Author.Name.ShouldEqual("Chris");
            stat.Description.ShouldEqual("25% of cars go over 100mph.");
            Assert.True(stat.CreateDate >= testStartTime);
        }
コード例 #4
0
        public void Author_can_be_created()
        {
            var author = new Author("Chris");

            Assert.Equal("Chris", author.Name);
        }