public void EndeavoursArePopulated()
        {
            IApiFulfillment impl = new FulfilmentImpl(new GameDataStub());
            List <GameLogicInterfaces.Models.Endeavour> actual = impl.GetPublicEndeavours();

            GameLogicInterfaces.Models.Endeavour e = actual[0];
            Assert.NotNull(e.Id);
            Assert.NotNull(e.Name);
            Assert.NotNull(e.Result);
            Assert.NotNull(e.Description);
            Assert.True(e.EffortEarnedSoFar <= e.EffortRequired);
        }
        public void ReturnsOnlyPublicEndeavours()
        {
            IApiFulfillment impl = new FulfilmentImpl(new GameDataStub());
            List <GameLogicInterfaces.Models.Endeavour> actual = impl.GetPublicEndeavours();

            Assert.Single(actual);
            GameLogicInterfaces.Models.Endeavour e = actual[0];
            Assert.Equal("6bcdb901-dab3-4091-a5c9-000000000070", e.Id);
            Assert.Equal("Test Public Endeavour", e.Name);
            Assert.Equal("The recent sabbat incursion is covered up", e.Result);
            Assert.Equal("Exists to test public endeavours such as calls to arms, cover ups, or public works projects.", e.Description);
            Assert.Equal <uint>(0, e.EffortEarnedSoFar);
            Assert.Equal <uint>(100, e.EffortRequired);
        }
        public void ReturnsOnlyMyPrivateEndeavours()
        {
            IApiFulfillment impl = new FulfilmentImpl(new GameDataStub());
            List <GameLogicInterfaces.Models.Endeavour> actual = impl.GetMyEndeavours(MR_CHARACTER_FIRST_ID);

            Assert.Single(actual);
            GameLogicInterfaces.Models.Endeavour e = actual[0];
            Assert.Equal("6bcdb901-dab3-4091-a5c9-000000000080", e.Id);
            Assert.Equal("Test Private Endeavour", e.Name);
            Assert.False(e.IsPublic);
            Assert.Equal("Camarilla influence is increased", e.Result);
            Assert.Equal("Exists to test private endeavours such as building haven or influence, research, or gaining status", e.Description);
            Assert.Equal <uint>(3, e.EffortEarnedSoFar);
            Assert.Equal <uint>(15, e.EffortRequired);
        }
        public GameDataStub()
        {
            Domain d1 = new Domain()
            {
                Id          = "6bcdb901-dab3-4091-a5c9-000000000010",
                Name        = "An abandoned lot",
                Description = "This domain is not very interesting"
            };
            Domain d2 = new Domain()
            {
                Id          = "6bcdb901-dab3-4091-a5c9-000000000020",
                Name        = "A small park",
                Description = "Well maintained and popular"
            };

            _domains.Add(d1);
            _domains.Add(d2);

            Character c1 = new Character()
            {
                Id   = "6bcdb901-dab3-4091-a5c9-000000000030",
                Name = "Mr Character First"
            };
            Character c2 = new Character()
            {
                Id   = "6bcdb901-dab3-4091-a5c9-000000000040",
                Name = "Ms Character Second",
                PublicDescription = "Sassy"
            };

            _characters.Add(c1);
            _characters.Add(c2);

            Asset a1 = new Asset()
            {
                Id          = "6bcdb901-dab3-4091-a5c9-000000000050",
                Name        = "Investments",
                Description = "Well hidden source of income"
            };
            Asset a2 = new Asset()
            {
                Id          = "6bcdb901-dab3-4091-a5c9-000000000060",
                Name        = "Occult Library",
                Description = "A collection of books and scrolls with a focus on ancient egypt"
            };

            _assets.Add(a1);
            _assets.Add(a2);
            _characterAssets.Add(c1.Id, new List <string>()
            {
                a1.Id
            });

            GameLogicInterfaces.Models.Endeavour e1 = new GameLogicInterfaces.Models.Endeavour()
            {
                Id             = "6bcdb901-dab3-4091-a5c9-000000000070",
                Name           = "Test Public Endeavour",
                IsPublic       = true,
                Result         = "The recent sabbat incursion is covered up",
                Description    = "Exists to test public endeavours such as calls to arms, cover ups, or public works projects.",
                EffortRequired = 100
            };
            GameLogicInterfaces.Models.Endeavour e2 = new GameLogicInterfaces.Models.Endeavour()
            {
                Id                = "6bcdb901-dab3-4091-a5c9-000000000080",
                Name              = "Test Private Endeavour",
                Result            = "Camarilla influence is increased",
                Description       = "Exists to test private endeavours such as building haven or influence, research, or gaining status",
                EffortEarnedSoFar = 3,
                EffortRequired    = 15
            };
            _endeavours.Add(e1);
            _endeavours.Add(e2);
            _characterEndeavours.Add(c1.Id, new List <string> {
                e2.Id
            });
        }
 internal static ResponseEndeavourDirectoryEntry ToResponseEndeavourDirectoryEntry(GameLogicInterfaces.Models.Endeavour c)
 {
     return(new ResponseEndeavourDirectoryEntry()
     {
         Id = c.Id,
         Name = c.Name,
         ProgressPercent = calculatePercentageProgress(c.EffortEarnedSoFar, c.EffortRequired)
     });
 }