示例#1
0
        public void Apply_NotACharacter_Test()
        {
            var entity   = Mock.Of <IEntity>();
            var confused = new Confused();

            confused.Apply(entity);
            Assert.IsTrue(true); // If we made it here without exception then the test passed
        }
    static void Main()
    {
        Confused c = new Confused();

        System.Console.WriteLine(c.GetMyClass());
        System.Console.WriteLine(c.GetMyClass <MyClass>());
        System.Console.WriteLine(c.GetMyClass <InheritedClass>());
    }
示例#3
0
        public void Remove_Character_RemovesConfusedAndFlatFooted_NotAlreadyPresent_Test()
        {
            var character = CreateMockCharacter();
            var confused  = new Confused();

            confused.Apply(character);
            confused.Remove(character);
            Assert.AreEqual(0, character.Conditions.Count);
        }
示例#4
0
        public void Apply_Character_WithExistingConfusedCondition_Test()
        {
            var character = CreateMockCharacter();

            character.Conditions.Add(new Confused());
            var confused = new Confused();

            confused.Apply(character);
        }
示例#5
0
        public void Apply_Character_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var confused  = new Confused();

            confused.Apply(character);
            Assert.AreEqual(EntityIds.CONFUSED_CONDITION_ID, character.Conditions[0].Id);
            Assert.AreSame(confused, character.Conditions[0]);
        }
示例#6
0
        public void Apply_Character_AddsFlatFootedCondition_NotAlreadyPresent_Test()
        {
            var character = CreateMockCharacter();
            var confused  = new Confused();

            confused.Apply(character);
            var flatFooted = (FlatFooted)character.Conditions.FirstOrDefault(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID);

            Assert.IsNotNull(flatFooted);
            Assert.AreEqual(EntityIds.FLAT_FOOTED_CONDITION_ID, flatFooted.Id);
            Assert.AreEqual(1, flatFooted.FlatFootedFrom.Count);
            Assert.AreEqual(FlatFooted.AllCharacters, flatFooted.FlatFootedFrom[0]);
        }
示例#7
0
        public void Apply_Character_AddsFlatFootedCondition_AlreadyPresentButNotAllCharacters_Test()
        {
            var character          = CreateMockCharacter();
            var existingFlatFooted = new FlatFooted(1, 2, 3);
            var confused           = new Confused();

            confused.Apply(character);
            var flatFooted = (FlatFooted)character.Conditions.FirstOrDefault(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID);

            Assert.IsNotNull(flatFooted);
            Assert.AreEqual(EntityIds.FLAT_FOOTED_CONDITION_ID, flatFooted.Id);
            Assert.AreEqual(4, flatFooted.FlatFootedFrom.Count);
            Assert.IsTrue(flatFooted.FlatFootedFrom.Contains(FlatFooted.AllCharacters));
            Assert.IsTrue(flatFooted.FlatFootedFrom.Contains(1));
            Assert.IsTrue(flatFooted.FlatFootedFrom.Contains(2));
            Assert.IsTrue(flatFooted.FlatFootedFrom.Contains(3));
        }
示例#8
0
        public void Remove_Character_FlatFootedAlreadyExists_Test()
        {
            var character          = CreateMockCharacter();
            var existingFlatFooted = new FlatFooted(1, 2, 3);
            var confused           = new Confused();

            existingFlatFooted.Apply(character);
            confused.Apply(character);
            confused.Remove(character);
            var flatFooted = (FlatFooted)character.Conditions.FirstOrDefault(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID);

            Assert.IsNotNull(flatFooted);
            Assert.AreEqual(EntityIds.FLAT_FOOTED_CONDITION_ID, flatFooted.Id);
            Assert.AreEqual(3, flatFooted.FlatFootedFrom.Count);
            Assert.IsTrue(flatFooted.FlatFootedFrom.Contains(1));
            Assert.IsTrue(flatFooted.FlatFootedFrom.Contains(2));
            Assert.IsTrue(flatFooted.FlatFootedFrom.Contains(3));
        }
        public ActionResult GetConfused()
        {
            var    today         = DateTime.Today.Date.ToString("yyyyMMdd");
            string fileLoc       = @"C:\Users\Jack\source\repos\DailyPerformanceReportAuto\";
            string confusedHome  = (fileLoc + "HomeInsurerHome_" + today + ".xlsx");
            string confusedQuote = (fileLoc + "QuoteYourHomeHome_" + today + ".xlsx");

            var getconfused = new DownloadAndSaveConfusedFiles();

            getconfused.GetConfused();


            Confused C = new Confused();

            C.AddConfused(confusedHome, confusedQuote);

            return(Json(new { success = "Confused Excel information gathered successfully" }, JsonRequestBehavior.AllowGet));
        }
示例#10
0
 private void ShowConfusedEyes()
 {
     imgLeftEye.Source  = new BitmapImage(new Uri(this.BaseUri, "/Assets/Spiral.jpg"));
     imgRightEye.Source = new BitmapImage(new Uri(this.BaseUri, "/Assets/Spiral.jpg"));
     Confused.Begin();
 }
 protected virtual void OnConfused()
 {
     Confused?.Invoke(this, EventArgs);
 }