Ejemplo n.º 1
0
        public void Test_Small()
        {
            var sut = new Small();

            Assert.True(sut.Name.Equals("Small"));
            Assert.True(sut.Price.Equals(5.00m));
        }
Ejemplo n.º 2
0
        public void SmallWithNoInputsReturnsPoundValue()
        {
            var function = new Small();
            var result   = function.Execute(FunctionsHelper.CreateArgs(), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Ejemplo n.º 3
0
        public void SmallWithNumericStringInputReturnsPoundNum()
        {
            var function = new Small();
            var result   = function.Execute(FunctionsHelper.CreateArgs("5", "56"), this.ParsingContext);

            Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result.Result).Type);
        }
Ejemplo n.º 4
0
        internal static FlatReportDto TimeSeriesReport(IEnumerable <Small> devices, IEnumerable <TelemetryData> telemetryDataList)
        {
            var flatReportDto = new FlatReportDto
            {
                Properties = new List <string>(),
                Rows       = new List <FlatRowDto>()
            };

            Small currentDevice = null;

            foreach (var telemetryData in telemetryDataList)
            {
                if (currentDevice == null || currentDevice.Id != telemetryData.DeviceId)
                {
                    currentDevice = new Small
                    {
                        Id   = telemetryData.DeviceId,
                        Name = devices.Single(d => d.Id == telemetryData.DeviceId).Name
                    };
                }
                var fields     = ExtractFields(telemetryData.Payload);
                var flatRowDto = new FlatRowDto
                {
                    DeviceId  = currentDevice.Id,
                    Name      = currentDevice.Name,
                    Timestamp = telemetryData.Time.ToUnixTime(),
                    Fields    = fields
                };
                flatReportDto.Rows.Add(flatRowDto);

                FillProperties(fields, flatReportDto.Properties);
            }

            return(flatReportDto);
        }
Ejemplo n.º 5
0
            public override string ToString()
            {
                string display;

                if (Large > 0)
                {
                    if (Small == 1 && Large == 1)
                    {
                        display = "1 Large and 1 Small Skill Injector";
                    }
                    else if (Small > 0)
                    {
                        // 2 Large and 2 Small Skill Injectors
                        display = string.Format("{0:D} Large and {1:D} Small Skill Injectors",
                                                Large, Small);
                    }
                    else
                    {
                        // 1 Large Skill Injector(s)
                        display = string.Format("{0:D} Large Skill Injector{1}", Large,
                                                Large.S());
                    }
                }
                else
                {
                    // 3 Small Skill Injector(s)
                    display = string.Format("{0:D} Small Skill Injector{1}", Small, Small.S());
                }
                return(display);
            }
Ejemplo n.º 6
0
    public static int test_5_pass_small_struct()
    {
        Small v = get_small(1);

        if (receive_small(7, v, 9) != 0)
        {
            return(0);
        }
        if (receive_small(7, get_small(1), 9) != 0)
        {
            return(1);
        }
        if (receive_small_sparc_many_args(1, 2, 3, 4, 5, 6, v, 9) != 0)
        {
            return(2);
        }
        v = return_small(v);
        if (v.b1 != 1)
        {
            return(3);
        }
        if (v.b2 != 2)
        {
            return(4);
        }
        return(5);
    }
Ejemplo n.º 7
0
        /// <summary>
        /// Returns true if BrandedFoodObjectPackagingPhotosFront instances are equal
        /// </summary>
        /// <param name="other">Instance of BrandedFoodObjectPackagingPhotosFront to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BrandedFoodObjectPackagingPhotosFront other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Small == other.Small ||
                     Small != null &&
                     Small.Equals(other.Small)
                     ) &&
                 (
                     Thumb == other.Thumb ||
                     Thumb != null &&
                     Thumb.Equals(other.Thumb)
                 ) &&
                 (
                     Display == other.Display ||
                     Display != null &&
                     Display.Equals(other.Display)
                 ));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Método que linka aos bancos de dados por meio do MDAC 2.8
        /// </summary>
        public void conectar()
        {
            if (DB4.State == 0)
            {
                DB4.CursorLocation   = CursorLocationEnum.adUseServer;
                DB4.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + endereco + "BD4.mdb;Persist Security Info=False;Jet OLEDB:Database Password=''";
                DB4.Open();
            }

            if (Contas.State == 0)
            {
                Contas.CursorLocation   = CursorLocationEnum.adUseServer;
                Contas.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + endereco + "contas.mdb;Persist Security Info=False;Jet OLEDB:Database Password=495798";
                Contas.Open();
            }

            if (Small.State == 0)
            {
                Small.CursorLocation = CursorLocationEnum.adUseServer;
                //Small.ConnectionString = @"Dsn=Small;Driver={Firebird/InterBase(r) driver};dbname=100.0.0.250:C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
                //Small.ConnectionString = @"Dsn=small_local;Driver={Firebird/InterBase(r) driver};dbname=C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
                Small.ConnectionString = endSamll;
                Small.Open();
            }
        }
Ejemplo n.º 9
0
 // Token: 0x060003E2 RID: 994 RVA: 0x0001E49C File Offset: 0x0001C69C
 public static void drawSmallImage(mGraphics g, int id, int f, int x, int y, int w, int h, int transform, int anchor)
 {
     if (SmallImage.imgbig == null)
     {
         Small small = SmallImage.imgNew[id];
         if (small == null)
         {
             SmallImage.createImage(id);
         }
         else
         {
             g.drawRegion(small.img, 0, f * w, w, h, transform, x, y, anchor);
         }
         return;
     }
     if (SmallImage.smallImg != null)
     {
         if (id >= SmallImage.smallImg.Length || SmallImage.smallImg[id] == null || SmallImage.smallImg[id][1] >= 256 || SmallImage.smallImg[id][3] >= 256 || SmallImage.smallImg[id][2] >= 256 || SmallImage.smallImg[id][4] >= 256)
         {
             Small small2 = SmallImage.imgNew[id];
             if (small2 == null)
             {
                 SmallImage.createImage(id);
             }
             else
             {
                 small2.paint(g, transform, f, x, y, w, h, anchor);
             }
         }
         else if (SmallImage.smallImg[id][0] != 4 && SmallImage.imgbig[SmallImage.smallImg[id][0]] != null)
         {
             g.drawRegion(SmallImage.imgbig[SmallImage.smallImg[id][0]], 0, f * w, w, h, transform, x, y, anchor);
         }
         else
         {
             Small small3 = SmallImage.imgNew[id];
             if (small3 == null)
             {
                 SmallImage.createImage(id);
             }
             else
             {
                 small3.paint(g, transform, f, x, y, w, h, anchor);
             }
         }
     }
     else if (GameCanvas.currentScreen != GameScr.gI())
     {
         Small small4 = SmallImage.imgNew[id];
         if (small4 == null)
         {
             SmallImage.createImage(id);
         }
         else
         {
             small4.paint(g, transform, f, x, y, w, h, anchor);
         }
     }
 }
Ejemplo n.º 10
0
        public void SmallShouldReturnTheSecondSmallestNumberIf2()
        {
            var func   = new Small();
            var args   = FunctionsHelper.CreateArgs(FunctionsHelper.CreateArgs(4, 1, 2, 3), 2);
            var result = func.Execute(args, _parsingContext);

            Assert.AreEqual(2d, result.Result);
        }
Ejemplo n.º 11
0
        public void SmallShouldReturnTheSmallestNumberIf1()
        {
            var func   = new Small();
            var args   = FunctionsHelper.CreateArgs(FunctionsHelper.CreateArgs(1, 2, 3), 1);
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(1, result.Result);
        }
Ejemplo n.º 12
0
        public void SmallWithInvalidArgumentReturnsPoundValue()
        {
            var func   = new Small();
            var args   = FunctionsHelper.CreateArgs();
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Ejemplo n.º 13
0
    public static void Main(string[] args)
    {
        covarDel del = Method1; // делегат ожидает возвращаемого типа Small (базовый класс), но мы все равно можем назначить Method1, который возвращает Big (производный класс)

        Small sm1 = del(new Big());

        del= Method2; // имеет ту же сигнатуру, что и делегат
        Small sm2 = del(new Big());
    }
Ejemplo n.º 14
0
        public Covariance()
        {
            covarDel del = Method1;

            del += Method2;
            del += Method3;

            Small sm = del(new Big());
        }
Ejemplo n.º 15
0
    // Test alignment of small structs

    static Small get_small(byte v)
    {
        Small r = new Small();

        r.b1 = v;
        r.b2 = (byte)(v + 1);

        return(r);
    }
Ejemplo n.º 16
0
        public void SmallShouldPoundNumIfIndexOutOfBounds()
        {
            var func   = new Small();
            var args   = FunctionsHelper.CreateArgs(FunctionsHelper.CreateArgs(4, 1, 2, 3), 6);
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(OfficeOpenXml.FormulaParsing.ExpressionGraph.DataType.ExcelError, result.DataType);
            Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)(result.Result)).Type);
        }
Ejemplo n.º 17
0
        public void TopImageVersionsPropertyChangedShouldBeFired()
        {
            //arrange
            var small = new Small();
            var thumb = new Thumb();

            //Assert
            PropertyChangedAsserter.AssertPropertyChanged(small, (x) => x.url = "test", "url");
            PropertyChangedAsserter.AssertPropertyChanged(thumb, (x) => x.url = "test", "url");
        }
Ejemplo n.º 18
0
 private static void CovarianceTest()
 {
     //covariance allows you to use a derived class where a base class is expected (rule: can accept big if small is expected).
     Small s1 = new Small();
     Small s2 = new Big();
     Small s3 = new Bigger();
     Big   b1 = new Big();
     Big   b2 = new Bigger();
     //Big b3 = new Small();
 }
        private static void Example2()
        {
            //
            Del d = Method1;

            d += Method2;
            d += Method3;
            d += Method4;
            Small sm = d(new Big());
        }
Ejemplo n.º 20
0
        public static void Run()
        {
            covarDel del = Method1;

            Small sm1 = del(new Big());

            del = Method2;

            Small sm2 = del(new Big());
        }
Ejemplo n.º 21
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Small.GetHashCode();
         hashCode = (hashCode * 397) ^ Normal.GetHashCode();
         hashCode = (hashCode * 397) ^ Large.GetHashCode();
         hashCode = (hashCode * 397) ^ XLarge.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 22
0
        public SAV3FRLG(byte[] data) : base(data)
        {
            Initialize();

            // Fix save files that have an overflow corruption with the Pokédex.
            // Future loads of this save file will cause it to be recognized as FR/LG correctly.
            if (IsCorruptPokedexFF())
            {
                WriteUInt32LittleEndian(Small.AsSpan(0xAC), 1);
            }
        }
Ejemplo n.º 23
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Large != null ? Large.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Medium != null ? Medium.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Original != null ? Original.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Small != null ? Small.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 24
0
 static int receive_small(int a, Small v, int b)
 {
     if (v.b1 != 1)
     {
         return(1);
     }
     if (v.b2 != 2)
     {
         return(2);
     }
     return(0);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Método retorna objeto do tipo ADODB.Connection para o banco de dados Small.gdb
 /// </summary>
 /// <returns></returns>
 public Connection getSmall()
 {
     if (Small.State == 0)
     {
         Small.CursorLocation = CursorLocationEnum.adUseServer;
         //Small.ConnectionString = @"Dsn=Small;Driver={Firebird/InterBase(r) driver};dbname=100.0.0.250:C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
         //Small.ConnectionString = @"Dsn=small_local;Driver={Firebird/InterBase(r) driver};dbname=C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
         Small.ConnectionString = endSamll;
         Small.Open();
     }
     return((Small.State == 0) ? null : Small);
 }
 public static void Execute()
 {
     Small sm1  = new Small();
     Small sm2  = new Big();
     Small sm3  = new Bigger();
     Big   big1 = new Big();
     Big   big2 = new Bigger();
     //IMyInterface2 imyint1 = new Bigger();
     //Huge h1 = new Big();
     //Big big3 = new Huge();
     //Big big3 = new Small();
 }
Ejemplo n.º 27
0
        private void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            skin.Dispose();
            Title.Dispose();
            Subtitle.Dispose();
            Small.Dispose();
            Path.Dispose();
        }
        private static void Example1()
        {

            //Covariance : an instance of more derived type object/class to be assign to less derived type object or class.
            //Pass derive type where base type expected
            Small sm1 = new Small();
            Small sm2 = new Big();
            Small sm3 = new Bigger();

            Big b1 = new Big();
            Big b2 = new Bigger();
            //Contravarience
            //Big b3 = new Small();
        }
Ejemplo n.º 29
0
        static void Main(string[] args)
        {
            YourClass NameInSuperSpace    = new YourClass(); // need using Super;
            Great     NameInSmashingSpace = new Great();     // need using Super.Smashing;

            Fabulous.MyClass NameInFabulous = new Fabulous.MyClass();
            Console.WriteLine(NameInSuperSpace);
            Console.WriteLine(NameInSmashingSpace);
            Console.WriteLine(NameInFabulous);
            Console.WriteLine(NameInFabulous.NameInSmashingSpace);
            Console.WriteLine(NameInFabulous.S);
            Small.DoSomething(); // can used by using static Super.Smashing.Small;
            Console.ReadKey();
        }
Ejemplo n.º 30
0
        static void Main(string[] args)
        {
            ICoffeType cappuccino      = new Cappuccino();
            Large      largeCappuccino = new Large();

            largeCappuccino.SetCoffeType(cappuccino);
            largeCappuccino.Make();

            ICoffeType espresso      = new Espresso();
            Small      smallEspresso = new Small();

            smallEspresso.SetCoffeType(espresso);
            smallEspresso.Make();
        }
Ejemplo n.º 31
0
	static int receive_small_sparc_many_args (int a, int a2, int a3, int a4, int a5, int a6, Small v, int b) {
		if (v.b1 != 1)
			return 1;
		if (v.b2 != 2)
			return 2;
		return 0;
	}
Ejemplo n.º 32
0
	static int receive_small (int a, Small v, int b) {
		if (v.b1 != 1)
			return 1;
		if (v.b2 != 2)
			return 2;
		return 0;
	}
Ejemplo n.º 33
0
	static Small return_small (Small s) {
		return s;
	}
Ejemplo n.º 34
0
	// Test alignment of small structs

	static Small get_small (byte v) {
		Small r = new Small ();
	
		r.b1 = v;
		r.b2 = (byte)(v + 1);

		return r;
	}
Ejemplo n.º 35
0
 public Image()
 {
     Small = new Small();
     Thumbnail = new Thumbnail();
     Medium = new Medium();
 }