-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestRemoveAndAddBlock.cs
More file actions
45 lines (43 loc) · 1.48 KB
/
TestRemoveAndAddBlock.cs
File metadata and controls
45 lines (43 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Minecraft.Models;
using Minecraft.Control;
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace UnitTestProject1
{
[TestClass]
public class TestRemoveAndAddBlock
{
[TestMethod]
public void NeedToRemoveAndAdd()
{
var blocks = new List<Block>();
var screen = new ScreenPoint(new Point() {X=0,Y=0});
var tick = 1000;
blocks.Add(new Block(670, 940, screen, 1000));
for (var i = 0; i < 1000; i++)
{
new ChangeStateFlyingUfoLevel().ChangeState(screen, tick, blocks);
new ChangeBlock().AddAndRemoveBlock(blocks, screen, tick);
}
Assert.IsTrue(blocks.Count==1);
}
[TestMethod]
public void NeedToRemoveAndAddTwoBlocks()
{
var blocks = new List<Block>();
var screen = new ScreenPoint(new Point() { X = 0, Y = 0 });
var tick = 1000;
blocks.Add(new Block(670, 940, screen, 1000));
blocks.Add(new Block(370, 940, screen, 1000));
for (var i = 0; i < 1000; i++)
{
new ChangeStateFlyingUfoLevel().ChangeState(screen, tick, blocks);
new ChangeBlock().AddAndRemoveBlock(blocks, screen, tick);
}
Assert.IsTrue(blocks.Count == 2);
}
}
}