Represents a static instance without a value.
Esempio n. 1
0
        public void EmptyObjectTest()
        {
            Empty e = new Empty();

            string json = e.ToJsonString();
            Assert.AreEqual("{}", json);
        }
Esempio n. 2
0
        public void CanEmptyObject()
        {
            var expected = new Empty();

            Serialize(expected);
            Reset();
            var actual = Deserialize<Empty>();
            Assert.Equal(expected, actual);
        }
Esempio n. 3
0
        private static void updateStatus()
        {

            string addr = String.Format("{0}:50051", ipAddr);
            Channel channel = new Channel(addr, ChannelCredentials.Insecure);

            McServer.McServerClient client = new McServer.McServerClient(channel);

            Empty statusReq = new Empty();
            BrewStatusReply rep = client.GetStatus(statusReq);
            channel.ShutdownAsync().Wait();

            status.RemainingMashStepList.Clear();

            foreach (MashProfileStep statusMp in rep.RemainingMashSteps)
            {
                var mps = new GFCalc.Domain.MashProfileStep();
                mps.Temperature = statusMp.Temperature;
                mps.StepTime = statusMp.StepTime;

                status.RemainingMashStepList.Add(mps);
            }

            var ol = status.RemainingMashStepList.OrderBy(x => x.Temperature).ToList();
            status.RemainingMashStepList.Clear();

            foreach (GFCalc.Domain.MashProfileStep ms in ol)
            {
                status.RemainingMashStepList.Add(ms);
            }

            status.Temperature = (int)(Math.Round(rep.MashTemperature));
            status.RemainingBoilTime = rep.RemainingBoilTime;
            status.State = rep.CurrentBrewStep;
            status.Progress = rep.Progress;
        }
 void LobbyFound(Empty e, Result result)
 {
     for (uint i = 0; i < LobbySearch.LobbyCount; i++)
     {
         var id = LobbySearch.GetLobbyByIndex(i);
         MyHud.Notifications.Add(new MyHudNotificationDebug(String.Format("Lobby found {0}, player count {1}", id.LobbyId, id.MemberCount), 3000));
         id.Leave();
     }
 }
Esempio n. 5
0
        private static void OtherSizes()
        {
            Console.WriteLine();
            long diff;

            long before = GC.GetTotalMemory(true);
            Empty obj = new Empty();
            long after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("Empty: \t\t" + diff);

            //---------------------------------------

            before = GC.GetTotalMemory(true);
            EmptyWithMethods obj0 = new EmptyWithMethods();
            after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("EmptyWithMethods: " + diff);

            //---------------------------------------

            before = GC.GetTotalMemory(true);
            OneInt32 obj1 = new OneInt32();
            after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("OneInt32: \t" + diff);

            //---------------------------------------

            before = GC.GetTotalMemory(true);
            TwoInt32 obj2 = new TwoInt32();
            after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("TwoInt32: \t" + diff);

            //---------------------------------------

            before = GC.GetTotalMemory(true);
            ThreeInt32 obj3 = new ThreeInt32();
            after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("ThreeInt32: \t" + diff);

            //---------------------------------------

            before = GC.GetTotalMemory(true);
            Mixed1 obj4 = new Mixed1();
            after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("Mixed1: \t" + diff);

            //---------------------------------------

            before = GC.GetTotalMemory(true);
            Mixed2 obj5 = new Mixed2();
            after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("Mixed2: \t" + diff);

            //---------------------------------------

            before = GC.GetTotalMemory(true);
            Mixed3 obj6 = new Mixed3();
            after = GC.GetTotalMemory(true);
            diff = after - before;

            Console.WriteLine("Mixed3: \t" + diff);

            //---------------------------------------
        }
 public Task<Empty> EmptyCall(Empty request, ServerCallContext context)
 {
     return Task.FromResult(Empty.DefaultInstance);
 }
 public void You_can_Use_an_instance_as_an_argument_to_GetInstance()
 {
     var empty = new Empty();
     mocker.Use(empty);
     var instance = mocker.CreateInstance<OneConstructor>();
     instance.Empty.ShouldBeSameAs(empty);
 }
 public OneConstructor(Empty empty)
 {
     this.Empty = empty;
 }
        public void get_keys_none_is_mapped()
        {
            var expected = new Empty();

            var sut = new EntityMapper<Empty>("Users");
            var keys = sut.GetKeys(expected);

            keys.Length.Should().Be(0);
        }
 public void Pop Empty Stack()
 {
     var nums = new ArrayStack<int>();
     nums.Pop();
 }
 private void UpdateSubscriptions_Helper(Empty unused) {
     List<XDoc> subscriptions = CalculateSubscriptions();
     if(SubscriptionsChanged != null) {
         _log.Debug("firing SubscriptionsChanged");
         SubscriptionsChanged(this, new SubscriptionEventArgs(subscriptions.ToArray()));
     }
 }
Esempio n. 12
0
 public Task<Empty> EmptyCallAsync(Empty request, CancellationToken token = default(CancellationToken))
 {
     var call = new Grpc.Core.Call<Empty, Empty>(emptyCallMethod, channel);
     return Calls.AsyncUnaryCall(call, request, token);
 }
Esempio n. 13
0
 public Empty EmptyCall(Empty request, CancellationToken token = default(CancellationToken))
 {
     var call = new Grpc.Core.Call<Empty, Empty>(emptyCallMethod, channel);
     return Calls.BlockingUnaryCall(call, request, token);
 }
 public override Task<Empty> EmptyCall(Empty request, ServerCallContext context)
 {
     return Task.FromResult(new Empty());
 }
Esempio n. 15
0
        public void PopulateIgnoresEmptyInstanceTest()
        {
            var expected = new Empty();

            var actual = Model.Populate(expected);

            actual.Should().BeSameAs(expected);
        }