示例#1
0
        public void TestSaveSimpleData()
        {
            StubDataStore stubDataStore = new StubDataStore();
            SimpleService simpleServiceToTest = new SimpleService(stubDataStore);

            var simpleData = TestUtils.GetRandomSimpleData();

            simpleServiceToTest.SaveSimpleData(simpleData);
        }
示例#2
0
        public void TestNullSaveSimpleData()
        {
            StubDataStore stubDataStore = new StubDataStore();
            SimpleService simpleServiceToTest = new SimpleService(stubDataStore);

            Assert.Throws(typeof(ArgumentNullException), () =>
            {
                simpleServiceToTest.SaveSimpleData(null);
            });
        }
示例#3
0
        public void ServiceSaveSimple()
        {
            StubDataStore stubDataStore = new StubDataStore();

            SimpleService simpleServiceToTest = new SimpleService(stubDataStore);

            Guid theID = Guid.NewGuid();

            var simpleData = new SimpleData(theID, "test1", 1000);

            simpleServiceToTest.SaveSimpleData(simpleData);

            var dataBack = simpleServiceToTest.GetSimpleData(theID);

            Assert.Equal(simpleData, dataBack);
        }